ImageEn, unit iexUserInteractions

TIEPdfViewer.Annotations

TIEPdfViewer.Annotations


Declaration

property Annotations: TPdfAnnotationList;


Description

Returns a list of all annotations on the current page.
Result will be nil if a page is not currently loaded.
Enable AllowAnnotationEditing to allow your users to edit objects in a PDF page.


Note: To show annotations, you must have iepoAnnotations specified for Options (which is the default)


Demo

Demo  Demos\PDF\PDFAnnotations\PdfAnnotations.dpr


Example

// Convert the selection to a rectangular annotation
procedure TfrmMain.btnAddAnnotationClick(Sender: TObject);
var
  selR: TRect;
  R: TDRect;
begin
  if ImageEnView1.Selected = False then
    exit;

  // Get selection as screen values
  selR := Rect( ImageEnView1.XBmp2Scr( ImageEnView1.SelX1 ),
                ImageEnView1.YBmp2Scr( ImageEnView1.SelY1 ),
                ImageEnView1.XBmp2Scr( ImageEnView1.SelX2 ),
                ImageEnView1.YBmp2Scr( ImageEnView1.SelY2 ));

  if ( selR.width < 10 ) or ( selR.height < 10 ) then
    exit;

  R := ImageEnView1.PdfViewer.ScrToPage( selR, true );
  ImageEnView1.PdfViewer.Annotations.NewAnnotation( R, patSquare, TColor2TRGBA( clGreen, 255 ), TColor2TRGBA( clYellow, 125 ));
end;



See Also

ContainsForm
AllowFormEditing
FormFieldFocused
FormModified