Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 169

Previous Page 168   Index   Next Page 170

Function Reference
Page 169 of 750
The function converts a PDF file to a specific PDF standard according to the parameter Type.
The regular DynaPDF versions contain a restricted version of CheckConformance() which cannot be
used if one or more pages from external PDF files were imported.
The conversion of arbitrary imported PDF files requires a separate license of the PDF/A Extension.
The PDF/A Extension represents in fact the unrestricted version of this and related functions
(ReplaceFont() and so on) which are required to convert arbitrary PDF files to PDF/A.
If the parameter Type is set to ctNormalize the function checks the PDF file for errors, rebuilds all
embedded fonts, optionally embeds non-embedded fonts, and repairs potential file errors if possible.
The resulting PDF file is easy to read and should not produce any printing error. Normalization is
useful in print workflows to detect potential errors before the file will be printed. This feature can be
used to check imported PDF files or pages. It is not meaningful when creating new PDF files with
DynaPDF.
Note that the flag if2Normalize must be set with SetImportFlags2() when importing external PDF
files. This flag enables additional error checks during import.
Note also that CheckConformance() is no preflight function! It is possible to check whether a PDF file
can be converted to PDF/A but it is not possible to check whether a file is already a valid PDF/A file!
This is a big difference since a preflight function must apply many additional checks, e.g. if PDF
objects are formatted as described in the PDF/A standard, as well as whether all other requirements
are already meet. Such checks are not required in a converter since the file structure and most objects
will be rebuild when the file is stored. It is not planned to extend the function with preflight
capabilities in the near future.
The function supports a large set of processing options but most of them are only meaningful if
imported PDF files or imported pages should be converted to PDF/A.
Important callback functions
OnFontNotFound
The callback function OnFontNotFound is not required to check newly created PDF files but it should
be set when converting imported PDF files. As shown in the example code, a default font like Arial
can be loaded whenever a PDF font cannot be found on the system. The function checks whether the
font metrics of the replacement font are compatible with the original PDF font.
OnReplaceICCProfile
The OnReplaceICCProfile callback function is optional too, but strongly required! The callback
function is called whenever a device color space is used and if no corresponding output intent or
default ICC based color space is available. It is also called if an embedded ICC profile must be
replaced due to damages or if an unsupported profile version is used.
 

Previous topic: CheckConformance

Next topic: PDF/A 2b or 3b