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

DynaPDF Manual - Page 733

Previous Page 732   Index   Next Page 734

Function Reference
Page 733 of 750
UTF32ToUTF16Ex
Syntax:
UI16* pdfUTF32ToUTF16Ex(
const PPDF* IPDF,
// Instance pointer
const UI32* Source, // UTF-32 Unicode string
UI32 ADDR Len)
// String length in characters
The function converts a UTF-32 Unicode string to UTF-16. UTF-32 is the default Unicode format on
Linux and UNIX operating systems. The input string must be defined in the CPU's byte ordering
(little-endian on a little-endian machine and big-endian on a big-endian machine), the output string
is also returned in the CPU's byte ordering.
The used conversion algorithm is binary save. The parameter Len holds the string length in
characters before and after conversion. The new string length can be longer then original one because
surrogates are expressed as two character sequence in UTF-16, but as one character in UTF-32.
The return value is a pointer to the original conversion buffer; it must not be freed or changed. The
function can be called multiple times without causing a memory leak. However, if the conversion
buffer is no longer needed it can be released with the function FreeUniBuf(). The buffer is
automatically released when CloseFile() or FreePDF() is called.
The function requires no open PDF file; it can be used at any time. Invalid character sequences are
skipped by the algorithm, they do not break conversion.
Return values:
If the function succeeds the return value is a pointer to the converted UTF-32 Unicode string. If the
function fails the return value is NULL. The only possible error during conversion is out of memory.
WatermarkAnnot
Syntax:
SI32 pdfWatermarkAnnot(
const PPDF* IPDF, // Instance pointer
double PosX,
// x-coordinate
double PosY,
// y-coordinate
double Width,
// Annotation width
double Height)
// Annotation height
The function creates a Watermark annotation. Watermark annotations have no interactive elements
like other annotation types. This property is useful in many cases because it is usually not possible to
select or change the contents of a watermark annotation in viewer applications.
The annotation has no appearance after it was created. Call CreateAnnotAP() to create an
appearance template for the annotation. After the appearance template was created you can draw
text, images or vector graphics into it. The template must be closed with EndTemplate() when
finished. It is also possible to import an external page or EMF contents into the template.
 

Previous topic: UTF32ToUTF16

Next topic: WebLink