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

Gnostice eDocEngine VCL Developer Guide
TgtPDFTextAnnot Class

This class represents a text annotation.

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

A text annotation is identified by an icon. When the user clicks the icon, the viewer application displays the annotation's popup window.

gtExPDFEng

procedure TForm1.Demo_TgtPDFTextAnnotation;
var
  gtPDFTextAnnot1: TgtPDFTextAnnot;
  gtPDFEngine1: TgtPDFEngine;
begin
  gtPDFEngine1 := TgtPDFEngine.Create(Nil);

  // Create a text annotation
  gtPDFTextAnnot1 := TgtPDFTextAnnot.Create;
  gtPDFTextAnnot1.Rect := gtRect(1, 1, 3, 2);
  gtPDFTextAnnot1.Name := tnNote;
  gtPDFTextAnnot1.Open := True;
  gtPDFTextAnnot1.BorderColor := clRed;
  gtPDFTextAnnot1.Contents := 'This is a note.';
  gtPDFTextAnnot1.Subject := 'Review by John Doe';
  gtPDFTextAnnot1.Title := 'Sample Doc';

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

    BeginDoc; // Create a PDF document
    Rectangle(1, 1, 3, 2, False);
    TextOut(1, 0.8, 'What is this?');
    // Add the annotation to the current page
    AddAnnotItem(gtPDFTextAnnot1);
    EndDoc; // Save the PDF document
  end;
end;
Properties
TgtPDFTextAnnot 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. 
 
Name 
Specifies icon used to display the annotation. 
 
Open 
Specifies whether the popup window of the annotation need to be open by default on viewer applications. 
 
Rect 
Specifies the location of the annotation on its page. 
 
Specifies text that needs to be used as the subject in the annotation's popup window. 
 
Specifies text that needs to be used as the title in the annotation's popup window. 
Methods
TgtPDFTextAnnot Class
 
Name 
Description 
 
Creates a new instance of this class. 
 
Destroys this instance.