Xojo Conferences
MBSOct2019CologneDE
XDCMarch2020NashvilleUS

DynaPDF Manual - Page 174

Previous Page 173   Index   Next Page 175

Function Reference
Page 174 of 770
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.
The conversion capabilities are very limited if this callback function is not set! If you get an error like
" File uses multiple device color spaces!" then please set this callback function so that ICC profiles
can be loaded if necessary.
General requirements when creating PDF/A files:
When importing PDF files or pages, the flag ifPrepareForPDFA must be set with
SetImportFlags().
Fonts must be embedded.
Images must not contain an alpha channel (PDF/A 1b only).
The flag gfUseImageColorSpace should be set when inserting images. This flag makes sure that
embedded ICC profiles will be considered. See SetGStateFlags() for further information.
PDF/A 1a files are tagged PDF files. That means the entire PDF file must be tagged and the
file must be created in the logical reading order. CheckConformance() does not validate the
structure tree and it does not check whether untagged elements are used on a page. See
CreateStructureTree(), OpenTag(), and so on for further information.
PDF/A files require an Ouptut Intent. The output intent represents the destination color space
for which the file was created. The output intent must be added after CheckConformance()
was executed. The required ICC profile must be attached depending on the return value of
the function (see Return Values below).
With CheckConformance() you can check whether prohibited features were used. Once the right
settings are found, it is normally no longer required to call this function when creating new PDF
files. The parameter CheckOptions should be set to coDefault or to zero so that prohibited features
raise an exception.
If you have a license of the PDF/A Extension for DynaPDF, then you can also convert arbitrary
imported PDF files to PDF/A 1b, 2b, or 3b.
 

Previous topic: Notice

Next topic: Type3 font conversion, Summay