This HotPDF Component sample adds a text annotation at the specified location of the PDF document.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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. |