AddFreeTextAnnotation

Text, Annotations and hotspot links

Description

Adds a free text annotation to the selected page. If a border and/or fill is specified using the Options parameter then the settings are retrieved from the current line colour, fill colour, line width, pen dash settings.

SetLineColor does not affect border colour. Border colour is currently set to the same colour as the text colour due to the way Acrobat works. SelectFont does not affect font style. Currently the font is hardcoded to the standard Helvetica font due to the way Acrobat works.

SetTextSize will affect text size correctly SetTextColor will affect text colour correctly SetLineWidth will adjust border width correctly SetTextAlign will adjust text alignment correctly

The SetTransparency function will *not* change the transparency of annotations. Use the new

When the selected document is below PDF 1.3, the writer automatically raises the effective PDF version to 1.3 because free text annotations were introduced in PDF 1.3.

AddFreeTextAnnotationEx function if you want to adjust transparency settings.

Syntax

Delphi

function TPDFlib.AddFreeTextAnnotation(Left, Top, Width, Height: Double; Const Text: WideString; Angle, Options: Integer): Integer;

ActiveX

Function PDFlib::AddFreeTextAnnotation(Left As Double, Top As Double, Width As Double, Height As Double, Text As String, Angle As Long, Options As Long) As Long

DLL

int DLAddFreeTextAnnotation(int InstanceID, double Left, double Top, double Width, double Height, wchar_t * Text, int Angle, int Options);

Parameters

LeftThe horizontal coordinate of the left edge of the annotation rectangle
TopThe vertical coordinate of the left edge of the annotation rectangle
WidthThe width of the annotation rectangle The height of the annotation rectangle
HeightThe text content of the annotation
Text
AngleThe angle of the drawn text. Can be 0, 90, 180 or 270.
Options0 = Outline 1 = Fill 2 = Fill and Outline int Options);