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

DynaPDF Manual - Page 14

Previous Page 13   Index   Next Page 15

Data types
Page 14 of 750
With very few exceptions, string values returned by DynaPDF are always null-terminated. A
string length returned by DynaPDF is always the length excluding the null-terminator.
Var Parameters
#ifdef __cplusplus
#define ADDR &
#else
#define ADDR *
#endif
Functions in DynaPDF, which pass a value to a function parameter are handled differently in C
and C++. C does not support the address operator & so that var parameters are defined as normal
pointers to pointers in C. DynaPDF checks whether a variable or NULL was passed to a function
before the function tries to access the variable. However, C++ does not allow to set a parameter to
NULL if it was declared with the address operator &.
Structures
Beginning with DynaPDF 2.5 all structures which can be extended in future versions contain the
member StructSize. This variable must be set to sizeof(StructureName). The structure size is used
to identify the version of a structure so that extensions do not break backward compatibility.
The structure size is automatically set in interfaces for C#, Visual Basic, Visual Basic .Net, and
Delphi. C/C++ programmers must set this member before the corresponding function can be
called:
Example:
TPDFCMap cmap;
cmap.StructSize = sizeof(TPDFCMap);
pdfGetCMap(pdf, handle, &cmap);
Multi-byte Strings
Unicode
DynaPDF supports Unicode strings in UTF-16-LE format on little-endian machines and UTF-16-
BE on big-endian machines. On target systems which use UTF-32 (LE or BE) as default string
format such as Linux or most UNIX OS, all strings must be converted to UTF-16 before passing to
DynaPDF.
You can use the predefined macro ToUTF16 to do this.
 

Previous topic: Data types

Next topic: CJK Multi-byte Strings