Insert free text annotation

<< Click to Display Table of Contents >>

Navigation:  Tasks > Annotation support >

Insert free text annotation

This Delphi example code inserts a free text annotation at a defined location.

 

var s : string;
    p : TWPAddAnnotationParam;
begin
  s := 'Example Text';
  FillChar(p,SizeOf(p),0);
  if InputQuery('Annotation (FreeText)', 'Text', s ) then
  begin
       p.pageno := 0; // First visible page
       p.x := 72;
       p.y := 72;
       p.w := 140;
       p.h := 32;
       p.typ := PChar('FreeText');
 

       // Prepare Comma list for properties
       s := '"prp.s.Contents=' + s + '",

             "font-color=#FF0000","font-size=11","font=Courier New"';
 
       p.Props := PChar(s);
 
       WPViewPDF.AddAnnotation( p );
  end;
end;