PDFium Delphi Component Docs

RemoveAnnotationObject method

Component: TPdf  ·  Unit: PDFium
Delete one page object from an annotation.

Syntax

procedure RemoveAnnotationObject(Index, ObjectIndex: Integer);

IndexInteger. Zero-based index of the annotation on the current page.
ObjectIndexInteger. Zero-based index of the object to delete, below AnnotationObjectCount. An out-of-range index raises EPdfError.

Description

Removes one stroke or shape from an ink or stamp annotation without touching the rest, the annotation dictionary, or the page content

Later objects renumber after a removal, so a loop that deletes several should walk the indexes backwards

On a PDFium build without annotation object editing the call raises rather than failing silently, so a caller always learns that the edit did not happen

See Also

AnnotationObjectCount, AddPathToAnnotation, DeleteAnnotation, UpdateAnnotationObject