eDocEngine VCL Professional Help » Symbol Reference » Namespaces of Helper Classes » gtExPDFEng Namespace » TgtPDFFreeTextAnnot Class

Gnostice eDocEngine VCL Developer Guide
TgtPDFFreeTextAnnot Class

This class represents a free text annotation.

Pascal
public TgtPDFFreeTextAnnot = class(TgtPDFAnnot);
C++
public: class TgtPDFFreeTextAnnot : public TgtPDFAnnot;
Description

A free text annotation displays text directly on the page. The text that is displayed by the annotation is specified using the Contents property.

gtExPDFEng

procedure TForm1.Demo_TgtPDFFreeTextAnnot;
var
  gtPDFFreeTextAnnot1: TgtPDFFreeTextAnnot;
  Font1: TFont;
  gtPDFEngine1: TgtPDFEngine;
begin
  gtPDFEngine1 := TgtPDFEngine.Create(Nil);

  // Create a font for the annotation
  Font1 := TFont.Create;
  Font1.Name := 'Comic Sans MS';
  Font1.Size := 9;

  // Create a free text annotation
  gtPDFFreeTextAnnot1 := TgtPDFFreeTextAnnot.Create;
  gtPDFFreeTextAnnot1.Rect := gtRect(2, 1.3, 4, 1.5);
  gtPDFFreeTextAnnot1.Contents := 'Something wrong here!';
  gtPDFFreeTextAnnot1.BorderColor := clMaroon;
  gtPDFFreeTextAnnot1.TextAlign := taCenter;
  gtPDFFreeTextAnnot1.TextColor := clRed;
  gtPDFFreeTextAnnot1.TextFont := Font1;

  with gtPDFEngine1 do
  begin
    Preferences.ShowSetupDialog := False;
    Preferences.OpenAfterCreate := True;
    FileName := 'free_text_annotation.pdf';

    Font.Name := 'Verdana';
    Font.Size := 12;

    BeginDoc; // Create a PDF document
    TextOut(1, 1, 'All''s well that ends in well.');
    // Add the free text annotation to the current page
    AddAnnotItem(gtPDFFreeTextAnnot1);
    EndDoc; // Save the PDF document
  end;
end;
Properties
TgtPDFFreeTextAnnot Class
 
Name 
Description 
 
Specifies border color of the annotation. 
 
Specifies text that needs to be used as the contents of the annotation's popup window. 
 
Rect 
Specifies the location of the annotation on its page. 
 
Specifies alignment of text displayed by the annotation. 
 
Specifies color of the text displayed by the annotation. 
 
Specifies font used to display the text. 
Methods
TgtPDFFreeTextAnnot Class
 
Name 
Description 
 
Creates a new instance of this class. 
 
Destroys this instance.