DynaPDF Manual - Page 177

Previous Page 176   Index   Next Page 178

Function Reference
Page 177 of 777
The OnReplaceICCProfile callback function is called when an additional default ICC based
color space must be created (this is the case when a page uses mixed color spaces), or when a
PDF file contains either damaged or ICC profiles of an unsupported version.
It is relatively seldom required to replace embedded ICC profiles but it is often required to
create additional default color spaces. So, it is very important that this callback function is
present. In the callback function you must call ReplaceICCProfile() with the requested color
profile type or return -1 if no such profile is available. The return value of the callback
function must be set to the one of ReplaceICCProfile().
The most common ICC profiles, which are also used in Adobes Acrobat or Reader, can be
downloaded from the Adobe website. These profiles are freely available and can be delivered
with your application. Please consider the license agreement of the profile package.
The pointer UserData of CheckConformance() is always passed unchanged to the callback functions.
This parameter is not available and not required in C#, VB .Net, or PHP.
Type3 font conversion
CheckConformance() is able to convert the 14 PDF standard fonts to Type3 counterparts if no
suitable system font is available (see SetFont/The 14 Standard Fonts for further information).
However, due to issues in Adobe's Acrobat or Reader, and due to the way how Type3 fonts are
defined in PDF, several restrictions must be considered:
Whereas all other font formats define only the shape of a glyph, Type3 fonts define the shape
and the way how glyphs must be painted, e.g. filled, stroked, or both. If a Type3 font should
be used with different text draw modes, then separate fonts must be created for each mode,
e.g. a font for filled glyphs, one for stroked and one for filled and stroked glyphs.
It is also not possible to draw stroked Type3 glyphs with arbitrary line widths, dash patterns,
or different style parameters as it is possible with every other font format since the specs say
that all these parameters must be explicitely defined in glyph content streams!
With exception of Acrobat 8 and 9, Acrobat and Reader use the current fill color instead of
the stroke color to render stroked Type3 glyphs that were defined with the d1 operator. The
only way to avoid this issue is to define the text color in every glyph. This requires again a
seperate font for every color with which the font should be used!
We can assume that it doesn't make sense to create dozens of fonts due to the idiotic definition of the
Type3 font format. This function creates exactly one Type3 counterpart for a standard font with the
graphics state parameters when the font is first used. If the font will be used with another draw
mode later then the function returns immediatly with an error and no PDF file will be produced.
If a stroked version of a font was created then it does not check whether the line cap style, line join
style, line dash pattern or line width will be changed if the font is used with the same text draw
mode later.

Previous topic: Important callback functions, OnFontNotFound, OnReplaceICCProfile, General requirements when creating PDF/A files:

Next topic: PDF/A 1b:, PDF/A 2b or 3b