DynaPDF Manual - Page 760

Previous Page 759   Index   Next Page 761

Function Reference
Page 760 of 777
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.
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