pdftools_sdk.pdf_a.validation.validator

Classes

Validator()

The class to validate the standard conformance of documents

class pdftools_sdk.pdf_a.validation.validator.Validator[source]

Bases: _NativeObject

The class to validate the standard conformance of documents

__init__()[source]
validate(document: Document, options: ValidationOptions | None = None) → ValidationResult[source]

Validate the standards conformance of a PDF document.

Parameters:
  • document (Document) – The document to check the quality of

  • options (Optional[ValidationOptions]) – The options or None for default validation options

Returns:

The result of the validation

Return type:

ValidationResult

Raises:
analyze(document: Document, options: AnalysisOptions | None = None) → AnalysisResult[source]

Analyze a PDF document in preparation for its conversion to PDF/A.

This method validates the document’s standards conformance like pdftools_sdk.pdf_a.validation.validator.Validator.validate. In addition to that, certain additional checks can be performed. However, the main difference is that the analysis result can be used in pdftools_sdk.pdf_a.conversion.converter.Converter.convert to convert the PDF document to PDF/A.

Parameters:
  • document (Document) – The document to analyze

  • options (Optional[AnalysisOptions]) – The options or None for default analysis options

Returns:

The result of the analysis

Return type:

AnalysisResult

Raises:
add_error_handler(handler: ErrorFunc) → None[source]

Add handler for the ErrorFunc event.

Parameters:

handler – Event handler. If a handler is added that is already registered, it is ignored.

remove_error_handler(handler: ErrorFunc) → None[source]

Remove registered handler of the ErrorFunc event.

Parameters:

handler – Event handler that shall be removed. If a handler is not registered, it is ignored.