DynaPDF Manual - Page 180

Previous Page 179   Index   Next Page 181

Function Reference
Page 180 of 787
The reason why this happens is very simple: When a PDF viewer uses a standard font to
display text of a non-available font, then glyphs will be scaled to the widths of the original
non-embedded font (the glyph widths are stored in the PDF file). That is the reason why it is
often not noticeable that a text was rendered with an alternate font.
However, this scaling is no longer available when the font becomes embedded. To achieve
the same result it would be required to create a synthetic font that contains scaled outlines
for every glyph but such a feature is not available in DynaPDF.
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
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!

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

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

Start Chat