pdftools_sdk.pdf_a.validation.analysis_result
Classes
|
The PDF/A analysis result |
- class pdftools_sdk.pdf_a.validation.analysis_result.AnalysisResult(handle)[source]
Bases:
_NativeObject
The PDF/A analysis result
Result of the validator’s method
pdftools_sdk.pdf_a.validation.validator.Validator.analyze()
which is required for the conversion to PDF/A withpdftools_sdk.pdf_a.conversion.converter.Converter.convert()
.Note that
pdftools_sdk.pdf_a.validation.analysis_result.AnalysisResult
objects remain valid as long as theirpdftools_sdk.pdf.document.Document
has not been closed and the analysis result has not been used inpdftools_sdk.pdf_a.conversion.converter.Converter.convert()
.- property conformance: Conformance
The conformance used for analysis
The PDF/A level might differ from the
pdftools_sdk.pdf_a.validation.analysis_options.AnalysisOptions.conformance
. If the claimed PDF/A level of the input document is higher thanpdftools_sdk.pdf_a.validation.analysis_options.AnalysisOptions.conformance
, the higher level is used forpdftools_sdk.pdf_a.validation.analysis_result.AnalysisResult.conformance
.For example, if
pdftools_sdk.pdf_a.validation.analysis_options.AnalysisOptions.conformance
is PDF/A-2b, but the document’s claimed conformance is PDF/A-2u, the analysis checks if the document actually conforms to its claimed conformance PDF/A-2u. Because otherwise a conversion is required.- Returns:
pdftools_sdk.pdf.conformance.Conformance
- property recommended_conformance: Conformance
The recommended conversion conformance
The optimal PDF/A conformance for the conversion (i.e. the
pdftools_sdk.pdf_a.conversion.conversion_options.ConversionOptions.conformance
). The recommended conformance level might be higher than the analysis conformance, if the document actually contains all data required for the higher level. It might also be lower, if the document is missing some required data.- Returns:
pdftools_sdk.pdf.conformance.Conformance
- property is_conversion_recommended: bool
Whether the document should be converted to PDF/A
A conversion is generally recommended in the following cases:
If
pdftools_sdk.pdf_a.validation.analysis_result.AnalysisResult.is_conforming
is False, i.e. if the document does not conform to thepdftools_sdk.pdf_a.validation.analysis_result.AnalysisResult.conformance
.If the document is conforming, but other issues are found for which a conversion is highly recommended. For example, if certain corner cases of the specification are detected.
Note that in certain processes it might also be beneficial to convert a document if its conformance does not match the
pdftools_sdk.pdf_a.validation.analysis_result.AnalysisResult.recommended_conformance
. This will actually upgrade the PDF/A level of the input document.- Returns:
bool
- property is_conforming: bool
Whether the document is conforming
Whether the document conforms to the
pdftools_sdk.pdf_a.validation.analysis_result.AnalysisResult.conformance
. Note that even if this property returns True a conversion might still be recommended as indicated bypdftools_sdk.pdf_a.validation.analysis_result.AnalysisResult.is_conversion_recommended
.- Returns:
bool
- property is_signed: bool
Whether the document is digitally signed
- Returns:
bool
- property has_embedded_files: bool
Whether the document contains embedded files
- Returns:
bool
- property font_count: int
The number of fonts used in the document
- Returns:
int