Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 309

Previous Page 308   Index   Next Page 310

Function Reference
Page 309 of 770
The parameter Flags provides further information about the font characteristics:
Bit
Value
Description
1
1
Fixed pitch.
2
2
Serif font.
3
4
Symbolic font.
4
8
Script. Glyphs resemble cursive handwriting.
6
32
Non-symbolic font. Either bit 3 or bit 6 is set at time.
7
64
Italic. Glyphs have dominant vertical strokes that are slanted.
19
262144
Force Bold. Indication for a bold font. (Ignore this flag for non Type1 fonts)
DynaPDF supports a special import flag to enable high performance access on the font objects of
PDF files. This makes it possible to enumerate the fonts of a large number of PDF files as fast as
possible.
The usage is as follows (C++):
pdfCreateNewPDF(pdf, NULL);
pdfSetImportFlags(ifEnumFonts); // Import font objects only
pdfOpenImportFile(pdf, "c:/test.pdf", ptOpen, NULL);
pdfImportPDFFile(pdf, 1, 1.0, 1.0);
// Now we can enumerate all PDF fonts
pdfEnumDocFonts(pdf, NULL, pdf_EnumDocFontProc);
// Only the font objects were imported. Delete the PDF file now.
pdfFreePDF(pdf);
The import flag ifEnumFonts causes that only font objects are imported. Anything else that can be
discarded is not imported. After the fonts were enumerated the PDF file must be deleted. Do not try
to write the file on disk, this would cause errors because certain required PDF objects are not
available. To speed up processing make sure that the PDF instance is not always deleted and newly
created when a PDF file is processed. This is especially important if a large number of PDF files must
be processed. One PDF instance can be used on an arbitrary number of PDF files; there is no need to
delete it every time a PDF file was processed.
Return values:
If the function succeeds the return value is number of fonts enumerated. If the parameter EnumProc
is set to NULL the function returns the number of used fonts in the document.
 

Previous topic: EnumDocFonts

Next topic: EnumHostFonts