PDFium Delphi Component Docs

Annotation property

Component: TPdf  ·  Unit: PDFium
Indexed property — returns the annotation record at the given index on the current page (subtype, rect, color, contents, etc.)

Syntax

property Annotation[Index: Integer]: TPdfAnnotation; // read/write

Description

Indexed read/write property that returns or updates the annotation record at the given index on the current page

Requires Active to be True; the result is undefined when the index is outside the valid range, so pass values in 0 .. AnnotationCount - 1

The returned record is a snapshot of the value at the time of the call; subsequent edits to the document do not modify previously returned records

AttachmentPointSets contains every quadrilateral used by multi-line highlight, underline, squiggly, and strikeout annotations; AttachmentPoints remains a compatibility alias for the first set

For anLink annotations carrying a /URI action, HasLinkUri is populated as True and LinkUri holds the decoded URI target string; link annotations without a /URI action leave HasLinkUri as False so round-trip updates preserve non-URI link actions

Assigning the record writes changed values back to the annotation; set a Has* sentinel when an existing string must be explicitly cleared to an empty value

Parameters

IndexZero-based index in the range 0 .. AnnotationCount - 1

Remarks

Example

var
  I: Integer;
begin
  if not Pdf1.Active then Exit;
  for I := 0 to Pdf1.AnnotationCount - 1 do
  begin
    // inspect Pdf1.Annotation[I]
    Memo1.Lines.Add(IntToStr(I));
  end;
end;

See Also

AnnotationCount, CreateAnnotation, DeleteAnnotation