Options and Configuration

Most parsing scenarios work with defaults, but groupdocs.parser.options exposes classes to control how documents are opened and processed. Use these options to handle passwords, guide format detection, or tune search and text extraction modes.

Apply load options

from groupdocs.parser import Parser
from groupdocs.parser.options import LoadOptions

# Pass a password and open from a stream
with open("input/protected.pdf", "rb") as stream:
    options = LoadOptions("secret-password")
    with Parser(stream, options) as parser:
        reader = parser.get_text()
        print(reader if reader else "Text extraction isn't supported.")

The following sample file is used in this example: protected.pdf

When to use other options

  • Search options — control case-sensitivity or regex mode when calling search APIs.
  • Text/formatting options — request formatted text (HTML/Markdown/plain) where supported.
  • Parser settings — adjust resource loading or timeouts for specific environments.

Check the groupdocs.parser.options namespace for the complete list of option classes and their parameters, and pass them to the corresponding methods as documented in the API reference.