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

DynaPDF Manual - Page 317

Previous Page 316   Index   Next Page 318

Function Reference
Page 317 of 750
The text of the annotation is printed into the bounding box by applying a formatting algorithm so
that the text appears left aligned, right aligned, centered, or justified. Justified text is not directly
supported by Adobe's Acrobat. However, the annotation appears correctly on screen but the
alignment is set to left aligned text if the text will be changed in Acrobat.
The border of the annotation is drawn by using the current line width, stroke color and line dash
pattern. If the annotation should appear without a border set the line width to zero beforehand.
The border appears completely inside the bounding box of the annotation. This must be considered
because normal vector graphics such as rectangles, ellipses and so on are measured without the line
width. For instance, the real width of a rectangle is the width plus the line width.
A Free Text annotation requires a font. If no font is set beforehand Helvetica is used. The largest font
size that can be used in Free Text annotations is 12 units. If the active font uses a larger font size then
it will be changed to 12 units.
Text positioning issues:
Acrobat 7 or higher use a very unusual way to place text into a Free Text annotation. While the
baseline of text is very well defined in practically all typographics systems, Acrobat uses a dynamic
position depending on the height of the largest character in the first line. The baseline is placed at the
annotation's height - border width - cap height as long as the first line contains no character with an
accent (e.g. Ä, Ö, Ü, À, È, Ê, Ñ). Because the cap height is not large enough for accented characters
Acrobat adjusts the position of the first line if necessary. So, the text position depends on the contents
of the first text line.
DynaPDF places the text at the annotation's height - border width - font size. This is makes it
possible to change the text of a Free Text annotation without changing its position. However, if the
annotation will be edited with Adobe's Acrobat the text position will slightly change. If the text
position is important then it is mostly better to use text fields instead (see CreateTextField()).
This function is implemented in an Ansi and Unicode compatible variant.
Return values:
If the function succeeds the return value is the annotation handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
SI32 pdfFreeUniBuf(
const PPDF* IPDF) // Instance pointer
The function frees the internal buffer used by Unicode conversion functions such as
ConvToUnicode(), ToUTF16() and so on. The conversion is automatically freed by all conversion

Previous topic: FreeTextAnnot

Next topic: GetActionHandle