Pdftools SDK
|
Go to the source code of this file.
Typedefs | |
typedef void(PDFTOOLS_CALL * | TPdfToolsPdfAConversion_Converter_ConversionEventA) (void *pContext, const char *szDataPart, const char *szMessage, TPdfToolsPdfAConversion_EventSeverity iSeverity, TPdfToolsPdfAConversion_EventCategory iCategory, TPdfToolsPdfAConversion_EventCode iCode, const char *szContext, int iPageNo) |
The event for errors, warnings, and informational messages that occur during conversion. | |
typedef void(PDFTOOLS_CALL * | TPdfToolsPdfAConversion_Converter_ConversionEventW) (void *pContext, const WCHAR *szDataPart, const WCHAR *szMessage, TPdfToolsPdfAConversion_EventSeverity iSeverity, TPdfToolsPdfAConversion_EventCategory iCategory, TPdfToolsPdfAConversion_EventCode iCode, const WCHAR *szContext, int iPageNo) |
The event for errors, warnings, and informational messages that occur during conversion. | |
#define PDFTOOLS_CALL |
#define PdfToolsPdfAConversion_Converter_AddConversionEventHandler PdfToolsPdfAConversion_Converter_AddConversionEventHandlerA |
#define PdfToolsPdfAConversion_Converter_RemoveConversionEventHandler PdfToolsPdfAConversion_Converter_RemoveConversionEventHandlerA |
#define TPdfToolsPdfAConversion_Converter_ConversionEvent TPdfToolsPdfAConversion_Converter_ConversionEventA |
typedef void(PDFTOOLS_CALL * TPdfToolsPdfAConversion_Converter_ConversionEventA) (void *pContext, const char *szDataPart, const char *szMessage, TPdfToolsPdfAConversion_EventSeverity iSeverity, TPdfToolsPdfAConversion_EventCategory iCategory, TPdfToolsPdfAConversion_EventCode iCode, const char *szContext, int iPageNo) |
The event for errors, warnings, and informational messages that occur during conversion.
Report a conversion event that occurred in PdfToolsPdfAConversion_Converter_Convert. These events can be used to:
Note that if a document cannot be converted to the requested conformance, the PdfToolsPdfAConversion_Converter_Convert throws an exception. However, even if the output document meets all required standards, the conversion might have resulted in differences that might be acceptable in some processes but not in others. Such potentially critical conversion issues are reported as conversion events.
We suggest checking which conversion events can be tolerated in your conversion process and which must be considered critical:
severity
which is based on the event's category
. Review the suggested severity of each TPdfToolsPdfAConversion_EventCategory and determine the TPdfToolsPdfAConversion_EventSeverity to be used in your process.message
, context
, and page
in combination with the output file are helpful to make this decision. If a manual review is not feasible, critical warnings should be classified as an ePdfToolsPdfAConversion_EventSeverity_Error. An exception to this is, if all processed input documents are similar in their content, e.g. because they have been created by a single source (application). In this case, the conversion result can be verified using representative test files and the event severity chosen accordingly.[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 event message |
[in] | iSeverity | The suggested severity of the event. We suggest checking, which conversion events are tolerable in your conversion process and which must be considered critical. See the documentation of TPdfToolsPdfAConversion_Converter_ConversionEvent for a more detailed description. |
[in] | iCategory | The category of the event. This parameter can be used to:
|
[in] | iCode | The code identifying particular events which can be used for detection and specialized handling of specific events. For most applications, it suffices to handle events by category . |
[in] | szContext | A description of the context where the event occurred |
[in] | iPageNo | The page this event is associated to or 0 |
typedef void(PDFTOOLS_CALL * TPdfToolsPdfAConversion_Converter_ConversionEventW) (void *pContext, const WCHAR *szDataPart, const WCHAR *szMessage, TPdfToolsPdfAConversion_EventSeverity iSeverity, TPdfToolsPdfAConversion_EventCategory iCategory, TPdfToolsPdfAConversion_EventCode iCode, const WCHAR *szContext, int iPageNo) |
The event for errors, warnings, and informational messages that occur during conversion.
Report a conversion event that occurred in PdfToolsPdfAConversion_Converter_Convert. These events can be used to:
Note that if a document cannot be converted to the requested conformance, the PdfToolsPdfAConversion_Converter_Convert throws an exception. However, even if the output document meets all required standards, the conversion might have resulted in differences that might be acceptable in some processes but not in others. Such potentially critical conversion issues are reported as conversion events.
We suggest checking which conversion events can be tolerated in your conversion process and which must be considered critical:
severity
which is based on the event's category
. Review the suggested severity of each TPdfToolsPdfAConversion_EventCategory and determine the TPdfToolsPdfAConversion_EventSeverity to be used in your process.message
, context
, and page
in combination with the output file are helpful to make this decision. If a manual review is not feasible, critical warnings should be classified as an ePdfToolsPdfAConversion_EventSeverity_Error. An exception to this is, if all processed input documents are similar in their content, e.g. because they have been created by a single source (application). In this case, the conversion result can be verified using representative test files and the event severity chosen accordingly.[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 event message |
[in] | iSeverity | The suggested severity of the event. We suggest checking, which conversion events are tolerable in your conversion process and which must be considered critical. See the documentation of TPdfToolsPdfAConversion_Converter_ConversionEvent for a more detailed description. |
[in] | iCategory | The category of the event. This parameter can be used to:
|
[in] | iCode | The code identifying particular events which can be used for detection and specialized handling of specific events. For most applications, it suffices to handle events by category . |
[in] | szContext | A description of the context where the event occurred |
[in] | iPageNo | The page this event is associated to or 0 |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAConversion_ConversionOptions_GetConformance | ( | TPdfToolsPdfAConversion_ConversionOptions * | pConversionOptions, |
TPdfToolsPdf_Conformance * | pConformance ) |
The minimal target conformance.
If a conformance is set, it is used as the minimal target conformance. The PDF/A version of the conformance must match the PDF/A version of the analysisOptions of PdfToolsPdfAValidation_Validator_Analyze. If the conformance level cannot be achieved, the conversion will abort with the error ePdfTools_Error_Conformance. If a higher conformance level can be achieved, it is used automatically.
If NULL
is used, the optimal conformance determined in the analysis (i.e. PdfToolsPdfAValidation_AnalysisResult_GetRecommendedConformance) is used. It is highly recommended to use NULL
.
Default value: NULL
[in,out] | pConversionOptions | Acts as a handle to the native object of type TPdfToolsPdfAConversion_ConversionOptions. |
[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 BOOL PDFTOOLS_CALL PdfToolsPdfAConversion_ConversionOptions_GetCopyMetadata | ( | TPdfToolsPdfAConversion_ConversionOptions * | pConversionOptions | ) |
Whether to copy metadata Copy document information dictionary and XMP metadata. Default: TRUE.
[in,out] | pConversionOptions | Acts as a handle to the native object of type TPdfToolsPdfAConversion_ConversionOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsPdfAConversion_ConversionOptions_GetImageQuality | ( | TPdfToolsPdfAConversion_ConversionOptions * | pConversionOptions | ) |
Image quality of recompressed images.
The image quality for images that use a prohibited lossy compression type and must be recompressed. Supported values are 0.01
to 1.0
. A higher value means better visual quality at the cost of a larger file size. Recommended values range from 0.7
to 0.9
.
Example: JPX (JPEG2000) is not allowed in PDF/A-1. If a PDF contains a JPX compressed image, its compression type must be altered. Thus the image is converted to an image with JPEG compression using the image quality defined by this property. Copy document information dictionary and XMP metadata. Default value: 0.8
[in,out] | pConversionOptions | Acts as a handle to the native object of type TPdfToolsPdfAConversion_ConversionOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
-1.0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:0.1
or greater than 1
. PDFTOOLS_EXPORT TPdfToolsPdfAConversion_ConversionOptions *PDFTOOLS_CALL PdfToolsPdfAConversion_ConversionOptions_New | ( | void | ) |
NULL
if there is an error.
NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAConversion_ConversionOptions_SetConformance | ( | TPdfToolsPdfAConversion_ConversionOptions * | pConversionOptions, |
const TPdfToolsPdf_Conformance * | pConformance ) |
The minimal target conformance.
If a conformance is set, it is used as the minimal target conformance. The PDF/A version of the conformance must match the PDF/A version of the analysisOptions of PdfToolsPdfAValidation_Validator_Analyze. If the conformance level cannot be achieved, the conversion will abort with the error ePdfTools_Error_Conformance. If a higher conformance level can be achieved, it is used automatically.
If NULL
is used, the optimal conformance determined in the analysis (i.e. PdfToolsPdfAValidation_AnalysisResult_GetRecommendedConformance) is used. It is highly recommended to use NULL
.
Default value: NULL
[in,out] | pConversionOptions | Acts as a handle to the native object of type TPdfToolsPdfAConversion_ConversionOptions. |
[in] | pConformance | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAConversion_ConversionOptions_SetCopyMetadata | ( | TPdfToolsPdfAConversion_ConversionOptions * | pConversionOptions, |
BOOL | bCopyMetadata ) |
Whether to copy metadata Copy document information dictionary and XMP metadata. Default: TRUE.
[in,out] | pConversionOptions | Acts as a handle to the native object of type TPdfToolsPdfAConversion_ConversionOptions. |
[in] | bCopyMetadata | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAConversion_ConversionOptions_SetImageQuality | ( | TPdfToolsPdfAConversion_ConversionOptions * | pConversionOptions, |
double | dImageQuality ) |
Image quality of recompressed images.
The image quality for images that use a prohibited lossy compression type and must be recompressed. Supported values are 0.01
to 1.0
. A higher value means better visual quality at the cost of a larger file size. Recommended values range from 0.7
to 0.9
.
Example: JPX (JPEG2000) is not allowed in PDF/A-1. If a PDF contains a JPX compressed image, its compression type must be altered. Thus the image is converted to an image with JPEG compression using the image quality defined by this property. Copy document information dictionary and XMP metadata. Default value: 0.8
[in,out] | pConversionOptions | Acts as a handle to the native object of type TPdfToolsPdfAConversion_ConversionOptions. |
[in] | dImageQuality | Set value. |
0.1
or greater than 1
. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAConversion_Converter_AddConversionEventHandlerA | ( | TPdfToolsPdfAConversion_Converter * | pConverter, |
void * | pContext, | ||
TPdfToolsPdfAConversion_Converter_ConversionEventA | pFunction ) |
Adds event handler.
[in,out] | pConverter | 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 PdfToolsPdfAConversion_Converter_AddConversionEventHandlerW | ( | TPdfToolsPdfAConversion_Converter * | pConverter, |
void * | pContext, | ||
TPdfToolsPdfAConversion_Converter_ConversionEventW | pFunction ) |
Adds event handler.
[in,out] | pConverter | 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 PdfToolsPdfAConversion_Converter_AddInvoiceXml | ( | TPdfToolsPdfAConversion_Converter * | pConverter, |
TPdfToolsPdfAConversion_InvoiceType | iInvoiceType, | ||
const TPdfToolsSys_StreamDescriptor * | pInvoice, | ||
const TPdfToolsPdfAConversion_AFRelationship * | pAfRelationship ) |
Prepares the invoice XML file (ZUGFeRD or Factur-X) for embedding. Note: This requires the compliance to be set to PDF/A-3.
[in,out] | pConverter | Acts as a handle to the native object of type TPdfToolsPdfAConversion_Converter. |
[in] | iInvoiceType | The type of invoice. |
[in] | pInvoice | The XML invoice stream. |
[in] | pAfRelationship | If no value is provided, a sensible default value is chosen based on the invoice type and version. |
PDFTOOLS_EXPORT TPdfToolsPdf_Document *PDFTOOLS_CALL PdfToolsPdfAConversion_Converter_Convert | ( | TPdfToolsPdfAConversion_Converter * | pConverter, |
TPdfToolsPdfAValidation_AnalysisResult * | pAnalysis, | ||
TPdfToolsPdf_Document * | pDocument, | ||
const TPdfToolsSys_StreamDescriptor * | pOutStreamDesc, | ||
TPdfToolsPdfAConversion_ConversionOptions * | pOptions, | ||
TPdfToolsPdf_OutputOptions * | pOutOptions ) |
Convert a document to PDF/A. Note that it is highly recommended to use TPdfToolsPdfAConversion_Converter_ConversionEvent to detect critical conversion events.
[in,out] | pConverter | Acts as a handle to the native object of type TPdfToolsPdfAConversion_Converter. |
[in,out] | pAnalysis | The result of the document's analysis using PdfToolsPdfAValidation_Validator_Analyze. |
[in,out] | pDocument | The document to convert |
[in,out] | pOutStreamDesc | The stream where the converted document is written |
[in,out] | pOptions | The conversion options |
[in,out] | pOutOptions | The output options object |
NULL
if there is an error.
NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT TPdfToolsPdfAConversion_Converter *PDFTOOLS_CALL PdfToolsPdfAConversion_Converter_New | ( | void | ) |
NULL
if there is an error.
NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsPdfAConversion_Converter_RemoveConversionEventHandlerA | ( | TPdfToolsPdfAConversion_Converter * | pConverter, |
void * | pContext, | ||
TPdfToolsPdfAConversion_Converter_ConversionEventA | pFunction ) |
Removes event handler.
[in,out] | pConverter | 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 PdfToolsPdfAConversion_Converter_RemoveConversionEventHandlerW | ( | TPdfToolsPdfAConversion_Converter * | pConverter, |
void * | pContext, | ||
TPdfToolsPdfAConversion_Converter_ConversionEventW | pFunction ) |
Removes event handler.
[in,out] | pConverter | 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. |