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

DynaPDF Manual - Page 412

Previous Page 411   Index   Next Page 413

Function Reference
Page 412 of 750
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
Usage (C++):
BYTE* buffer = NULL;
UI32 bufSize = 0;
// Get a preview of the global XMP stream
if (pdfGetMetadata(pdf, mdoCatalog, -1, &buffer, &bufSize))
{
if (bufSize > 0)
{
// Do something with the data
}
}
GetMissingGlyphs
Syntax:
UI32* pdfGetMissingGlyphs(
const PPDF* IPDF, // Instance pointer
UI32 ADDR Count)
// Variable that holds the number of missing glyphs
The function returns the character codes that could not be found in the active font. If all characters
were found the return value is NULL.
Each character code is encoded as a 32 bit unsigned integer. The character codes which are stored in
this array correspond to the source string that was used in the function that outputs the text. For
example, if the active font was loaded with a 8 bit code page and if the Ansi version of WriteText()
was used, the array contains the 8 bit codes which could not be found. If the wide string version was
used the missing 16 bit codes will be returned.
If the active font is a CID font that uses an external CMap, a missing character code was maybe
constructed from a sequence of bytes or from two 16 bit codes (if a wide string function was used).
However, the 32 bit code can be easily converted back to the original code sequence. If the Ansi
version of a string function was used the algorithm looks as follows (C++):
UI32 i, p, value, count;
UI32* missingGlyphs = pdfGetMissingGlyphs(pdf, count);
// More than 4 bytes cannot be encoded in a 32 bit integer
BYTE sequence[4];
for (i = 0; i < count; i++)
{
value = missingGlyphs[i];
p
= 0;
while (value)
{
sequence[p] = (BYTE)value;
 

Previous topic: GetMetadata

Next topic: GetMovieAction