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

Gnostice eDocEngine VCL Developer Guide
TgtPDFCaretAnnot Class

This class represents a caret annotation.

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

Caret annotations are identified by a caret (^) symbol. They are typically used to visually indicate the presence of a text edit.

gtExPDFEng

procedure TForm1.Demo_TgtPDFCaretAnnot;
var
  gtPDFCaretAnnot1: TgtPDFCaretAnnot;
  Size1: TSize;
  X1, Y1, X2, Y2: Double;
  gtPDFEngine1: TgtPDFEngine;
begin
  gtPDFEngine1 := TgtPDFEngine.Create(Nil);

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

    // Store coordinates of the textout
    X1 := 1;
    Y1 := 1;

    // Obtain size of correct text in
    // textout in the current font size
    Size1 := TextSize('Hello', Font);

    // Store coordinates of the caret
    // - just below the textout
    X2 := X1 + (Size1.cx / 96);
    Y2 := Y1 + (Size1.cy / 96);

    // Create an caret annotation
    gtPDFCaretAnnot1 := TgtPDFCaretAnnot.Create;
    gtPDFCaretAnnot1.Rect := gtRect(X2, Y2, X2 + 0.1, Y2 + 0.1);
    gtPDFCaretAnnot1.Title := 'Document review';
    gtPDFCaretAnnot1.Subject := 'Spelling mistake 1';
    gtPDFCaretAnnot1.Contents :=
      'Your "Hello, world!" is not spelled correctly';
    gtPDFCaretAnnot1.BorderColor := clRed;

    BeginDoc;
    // Write textout
    TextOut(X1, Y1, 'Helloo, world');
    // Add caret annotation
    AddAnnotItem(gtPDFCaretAnnot1);
    EndDoc;
  end;
end;

 

Properties
TgtPDFCaretAnnot 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 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
TgtPDFCaretAnnot Class
 
Name 
Description 
 
Creates an instance of this class. 
 
Destroys this instance.