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
fromgroupdocs.parserimportParserfromgroupdocs.parser.optionsimportLoadOptions# Pass a password and open from a streamwithopen("input/protected.pdf","rb")asstream:options=LoadOptions("secret-password")withParser(stream,options)asparser:reader=parser.get_text()print(readerifreaderelse"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.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.