HotPDF Text Annotation

This HotPDF Component sample adds a text annotation at the specified location of the PDF document.

program Annotation;
{$APPTYPE CONSOLE}

uses
{$IFDEF VER230} System.Classes, System.SysUtils, Vcl.Graphics,
{$ELSE} Classes, SysUtils, Graphics, {$ENDIF} HPDFDoc;

var
  HotPDF: THotPDF;
begin
  HotPDF := THotPDF.Create(nil);
  try
    HotPDF.FileName := 'Annotation.pdf';
    HotPDF.BeginDoc;
    HotPDF.CurrentPage.TextOut(120,65,0,'Click the icon:');
    HotPDF.CurrentPage.AddTextAnnotation( 'This is a text annotation.' + #13#10  
      + 'Dies ist eine Textanmerkung.' + #13#10
      + 'Ceci est une annotation textuelle.' + #13#10, 
      Rect(120, 80, 140, 100), true, taComment, clBlue );
    HotPDF.EndDoc;
  finally
    HotPDF.Free;
  end;
end.

losLab

Devoted to developing PDF and Spreadsheet developer library, including PDF creation, PDF manipulation, PDF rendering library, and Excel Spreadsheet creation & manipulation library.