Errors and Exceptions

GroupDocs.Parser raises exceptions from groupdocs.parser.exceptions for invalid inputs, unsupported formats, and access issues. Catch these exceptions to provide clear feedback and retry logic.

Handle unsupported formats

from groupdocs.parser import Parser
from groupdocs.parser.exceptions import UnsupportedDocumentFormatException

try:
    with Parser("./unknown.xyz") as parser:
        reader = parser.get_text()
        print(reader if reader else "No text available.")
except Exception as e:
    print(e)

Troubleshooting checklist

  • Confirm the file path exists and is readable by the current user.
  • If the document is password-protected, provide the password via LoadOptions.
  • For image-heavy PDFs on Linux, install libgdiplus and font packages.
  • Review the API reference for method-specific exceptions and option requirements.
  • Check system requirements and ensure the correct .NET runtime is installed.