Pdftools SDK
|
Go to the source code of this file.
Typedefs | |
typedef void(PDFTOOLS_CALL * | TPdfToolsPdfAValidation_Validator_ErrorA) (void *pContext, const char *szDataPart, const char *szMessage, TPdfToolsPdfAValidation_ErrorCategory iCategory, const char *szContext, int iPageNo, int iObjectNo) |
typedef void(PDFTOOLS_CALL * | TPdfToolsPdfAValidation_Validator_ErrorW) (void *pContext, const WCHAR *szDataPart, const WCHAR *szMessage, TPdfToolsPdfAValidation_ErrorCategory iCategory, const WCHAR *szContext, int iPageNo, int iObjectNo) |
#define PDFTOOLS_CALL |
#define PdfToolsPdfAValidation_Validator_AddErrorHandler PdfToolsPdfAValidation_Validator_AddErrorHandlerA |
#define PdfToolsPdfAValidation_Validator_RemoveErrorHandler PdfToolsPdfAValidation_Validator_RemoveErrorHandlerA |
#define TPdfToolsPdfAValidation_Validator_Error TPdfToolsPdfAValidation_Validator_ErrorA |
typedef void(PDFTOOLS_CALL * TPdfToolsPdfAValidation_Validator_ErrorA) (void *pContext, const char *szDataPart, const char *szMessage, TPdfToolsPdfAValidation_ErrorCategory iCategory, const char *szContext, int iPageNo, int iObjectNo) |
Report a validation issue found in PdfToolsPdfAValidation_Validator_Analyze or PdfToolsPdfAValidation_Validator_Validate.
[in,out] | pContext | Context of the event callback. |
[in] | szDataPart | The data part is NULL for the main file and a data part specification for embedded files. Examples:
|
[in] | szMessage | The validation message |
[in] | iCategory | The category of the validation error |
[in] | szContext | A description of the context where the error occurred |
[in] | iPageNo | The page number this error is associated to or 0 |
[in] | iObjectNo | The number of the PDF object this error is associated to |
typedef void(PDFTOOLS_CALL * TPdfToolsPdfAValidation_Validator_ErrorW) (void *pContext, const WCHAR *szDataPart, const WCHAR *szMessage, TPdfToolsPdfAValidation_ErrorCategory iCategory, const WCHAR *szContext, int iPageNo, int iObjectNo) |
Report a validation issue found in PdfToolsPdfAValidation_Validator_Analyze or PdfToolsPdfAValidation_Validator_Validate.
[in,out] | pContext | Context of the event callback. |
[in] | szDataPart | The data part is NULL for the main file and a data part specification for embedded files. Examples:
|
[in] | szMessage | The validation message |
[in] | iCategory | The category of the validation error |
[in] | szContext | A description of the context where the error occurred |
[in] | iPageNo | The page number this error is associated to or 0 |
[in] | iObjectNo | The number of the PDF object this error is associated to |
PDFTOOLS_EXPORT TPdfToolsPdf_Conformance PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisOptions_GetConformance | ( | TPdfToolsPdfAValidation_AnalysisOptions * | pAnalysisOptions | ) |
The PDF/A conformance to validate.
It is recommended to use:
Default: "PDF/A-2b"
[in,out] | pAnalysisOptions | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
0
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisOptions_GetStrictMode | ( | TPdfToolsPdfAValidation_AnalysisOptions * | pAnalysisOptions | ) |
Whether to enable additional, strict validation checks.
Whether to check for potential issues that are corner cases of the PDF/A ISO Standard in which a conversion is strongly advised. Also see the documentation of PdfToolsPdfAValidation_AnalysisResult_IsConversionRecommended.
Default: TRUE
[in,out] | pAnalysisOptions | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT TPdfToolsPdfAValidation_AnalysisOptions *PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisOptions_New | ( | void | ) |
NULL
if there is an error.
NULL
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisOptions_SetConformance | ( | TPdfToolsPdfAValidation_AnalysisOptions * | pAnalysisOptions, |
TPdfToolsPdf_Conformance | iConformance ) |
The PDF/A conformance to validate.
It is recommended to use:
Default: "PDF/A-2b"
[in,out] | pAnalysisOptions | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisOptions. |
[in] | iConformance | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisOptions_SetStrictMode | ( | TPdfToolsPdfAValidation_AnalysisOptions * | pAnalysisOptions, |
BOOL | bStrictMode ) |
Whether to enable additional, strict validation checks.
Whether to check for potential issues that are corner cases of the PDF/A ISO Standard in which a conversion is strongly advised. Also see the documentation of PdfToolsPdfAValidation_AnalysisResult_IsConversionRecommended.
Default: TRUE
[in,out] | pAnalysisOptions | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisOptions. |
[in] | bStrictMode | Set value. |
PDFTOOLS_EXPORT TPdfToolsPdf_Conformance PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisResult_GetConformance | ( | TPdfToolsPdfAValidation_AnalysisResult * | pAnalysisResult | ) |
The conformance used for analysis.
The PDF/A level might differ from the PdfToolsPdfAValidation_AnalysisOptions_GetConformance. If the claimed PDF/A level of the input document is higher than PdfToolsPdfAValidation_AnalysisOptions_GetConformance, the higher level is used for PdfToolsPdfAValidation_AnalysisResult_GetConformance.
For example, if PdfToolsPdfAValidation_AnalysisOptions_GetConformance 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.
[in,out] | pAnalysisResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisResult. |
May indicate an error in certain scenarios. For further information see the note section below.
0
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisResult_GetFontCount | ( | TPdfToolsPdfAValidation_AnalysisResult * | pAnalysisResult | ) |
The number of fonts used in the document.
[in,out] | pAnalysisResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisResult. |
May indicate an error in certain scenarios. For further information see the note section below.
-1
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisResult_GetHasEmbeddedFiles | ( | TPdfToolsPdfAValidation_AnalysisResult * | pAnalysisResult | ) |
Whether the document contains embedded files.
[in,out] | pAnalysisResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisResult. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT TPdfToolsPdf_Conformance PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisResult_GetRecommendedConformance | ( | TPdfToolsPdfAValidation_AnalysisResult * | pAnalysisResult | ) |
The recommended conversion conformance The optimal PDF/A conformance for the conversion (i.e. the PdfToolsPdfAConversion_ConversionOptions_GetConformance). 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.
[in,out] | pAnalysisResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisResult. |
May indicate an error in certain scenarios. For further information see the note section below.
0
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisResult_IsConforming | ( | TPdfToolsPdfAValidation_AnalysisResult * | pAnalysisResult | ) |
Whether the document is conforming Whether the document conforms to the PdfToolsPdfAValidation_AnalysisResult_GetConformance. Note that even if this property returns TRUE a conversion might still be recommended as indicated by PdfToolsPdfAValidation_AnalysisResult_IsConversionRecommended.
[in,out] | pAnalysisResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisResult. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisResult_IsConversionRecommended | ( | TPdfToolsPdfAValidation_AnalysisResult * | pAnalysisResult | ) |
Whether the document should be converted to PDF/A.
A conversion is generally recommended in the following cases:
Note that in certain processes it might also be beneficial to convert a document if its conformance does not match the PdfToolsPdfAValidation_AnalysisResult_GetRecommendedConformance. This will actually upgrade the PDF/A level of the input document.
[in,out] | pAnalysisResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisResult. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_AnalysisResult_IsSigned | ( | TPdfToolsPdfAValidation_AnalysisResult * | pAnalysisResult | ) |
Whether the document is digitally signed.
[in,out] | pAnalysisResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_AnalysisResult. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_ValidationOptions_GetConformance | ( | TPdfToolsPdfAValidation_ValidationOptions * | pValidationOptions, |
TPdfToolsPdf_Conformance * | pConformance ) |
The conformance to be validated.
The required conformance or NULL
to validate the document's claimed conformance, i.e. PdfToolsPdf_Document_GetConformance.
The PDF validation verifies if the input document conforms to all standards associated with this conformance.
Note that it is generally only meaningful to validate the claimed conformance of a document.
Default value: NULL
, i.e. validate the document's claimed conformance.
[in,out] | pValidationOptions | Acts as a handle to the native object of type TPdfToolsPdfAValidation_ValidationOptions. |
[out] | pConformance | Retrieved value. |
[out]
argument returns NULL
. To determine if an error has occurred, check the error code as described in the note section below. PDFTOOLS_EXPORT TPdfToolsPdfAValidation_ValidationOptions *PDFTOOLS_CALL PdfToolsPdfAValidation_ValidationOptions_New | ( | void | ) |
NULL
if there is an error.
NULL
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_ValidationOptions_SetConformance | ( | TPdfToolsPdfAValidation_ValidationOptions * | pValidationOptions, |
const TPdfToolsPdf_Conformance * | pConformance ) |
The conformance to be validated.
The required conformance or NULL
to validate the document's claimed conformance, i.e. PdfToolsPdf_Document_GetConformance.
The PDF validation verifies if the input document conforms to all standards associated with this conformance.
Note that it is generally only meaningful to validate the claimed conformance of a document.
Default value: NULL
, i.e. validate the document's claimed conformance.
[in,out] | pValidationOptions | Acts as a handle to the native object of type TPdfToolsPdfAValidation_ValidationOptions. |
[in] | pConformance | Set value. |
PDFTOOLS_EXPORT TPdfToolsPdf_Conformance PDFTOOLS_CALL PdfToolsPdfAValidation_ValidationResult_GetConformance | ( | TPdfToolsPdfAValidation_ValidationResult * | pValidationResult | ) |
The validated conformance.
[in,out] | pValidationResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_ValidationResult. |
May indicate an error in certain scenarios. For further information see the note section below.
0
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_ValidationResult_IsConforming | ( | TPdfToolsPdfAValidation_ValidationResult * | pValidationResult | ) |
Whether the document is conforming Whether the document conforms to all standards referenced to the PdfToolsPdfAValidation_ValidationResult_GetConformance. Any issues found are reported as TPdfToolsPdfAValidation_Validator_Error.
[in,out] | pValidationResult | Acts as a handle to the native object of type TPdfToolsPdfAValidation_ValidationResult. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_Validator_AddErrorHandlerA | ( | TPdfToolsPdfAValidation_Validator * | pValidator, |
void * | pContext, | ||
TPdfToolsPdfAValidation_Validator_ErrorA | pFunction ) |
Adds event handler.
[in,out] | pValidator | Pointer to the object to which the event handler is added. |
[in,out] | pContext | The context of the event handler. |
[in] | pFunction | The event callback that is added. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_Validator_AddErrorHandlerW | ( | TPdfToolsPdfAValidation_Validator * | pValidator, |
void * | pContext, | ||
TPdfToolsPdfAValidation_Validator_ErrorW | pFunction ) |
Adds event handler.
[in,out] | pValidator | Pointer to the object to which the event handler is added. |
[in,out] | pContext | The context of the event handler. |
[in] | pFunction | The event callback that is added. |
PDFTOOLS_EXPORT TPdfToolsPdfAValidation_AnalysisResult *PDFTOOLS_CALL PdfToolsPdfAValidation_Validator_Analyze | ( | TPdfToolsPdfAValidation_Validator * | pValidator, |
TPdfToolsPdf_Document * | pDocument, | ||
TPdfToolsPdfAValidation_AnalysisOptions * | pOptions ) |
Analyze a PDF document in preparation for its conversion to PDF/A. This method validates the document's standards conformance like PdfToolsPdfAValidation_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 PdfToolsPdfAConversion_Converter_Convert to convert the PDF document to PDF/A.
[in,out] | pValidator | Acts as a handle to the native object of type TPdfToolsPdfAValidation_Validator. |
[in,out] | pDocument | The document to analyze |
[in,out] | pOptions | The options or NULL for default analysis options |
NULL
if there is an error.
NULL
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT TPdfToolsPdfAValidation_Validator *PDFTOOLS_CALL PdfToolsPdfAValidation_Validator_New | ( | void | ) |
NULL
if there is an error.
NULL
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_Validator_RemoveErrorHandlerA | ( | TPdfToolsPdfAValidation_Validator * | pValidator, |
void * | pContext, | ||
TPdfToolsPdfAValidation_Validator_ErrorA | pFunction ) |
Removes event handler.
[in,out] | pValidator | Pointer to the object from which the event handler is removed. |
[in,out] | pContext | The context of the event handler. |
[in] | pFunction | The event callback that is removed. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAValidation_Validator_RemoveErrorHandlerW | ( | TPdfToolsPdfAValidation_Validator * | pValidator, |
void * | pContext, | ||
TPdfToolsPdfAValidation_Validator_ErrorW | pFunction ) |
Removes event handler.
[in,out] | pValidator | Pointer to the object from which the event handler is removed. |
[in,out] | pContext | The context of the event handler. |
[in] | pFunction | The event callback that is removed. |
PDFTOOLS_EXPORT TPdfToolsPdfAValidation_ValidationResult *PDFTOOLS_CALL PdfToolsPdfAValidation_Validator_Validate | ( | TPdfToolsPdfAValidation_Validator * | pValidator, |
TPdfToolsPdf_Document * | pDocument, | ||
TPdfToolsPdfAValidation_ValidationOptions * | pOptions ) |
Validate the standards conformance of a PDF document.
[in,out] | pValidator | Acts as a handle to the native object of type TPdfToolsPdfAValidation_Validator. |
[in,out] | pDocument | The document to check the quality of |
[in,out] | pOptions | The options or NULL for default validation options |
NULL
if there is an error.
NULL
is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. Possible error codes: