Unit: FPdfDocumentStructure
function RemovePdfPageAnnotations(Source, Dest: TStream; PageNumber: Integer; const AnnotationObjects: array of Integer; const Options: TPdfAnnotationRemovalOptions; out Report: TPdfAnnotationRemovalReport): Boolean;
Removes annotations from one page and, on request, the structure content and ParentTree entries those annotations owned
Remarks
- The page dictionary is rewritten in one incremental revision with the unchanged catalogue, so object numbers, the document ID and every other page key survive
- With
RemoveOwnedStructurePeers the OBJR items whose /Obj is a removed annotation leave the structure tree together with their ParentTree entries; without it the page reference goes and the structure keeps its semantics at the boundary
- With
RemoveEmptiedStructureNodes an element left without content or children is removed deepest first and the structure root always stays
- Only
/Annot objects that appear in the selected page's /Annots are accepted: widgets belong to their form field and are rejected, as are duplicate numbers and annotations of another page
- The removed annotation object keeps its own body in the file; only the page reference is withdrawn, so a caller that keeps the number can still read it
- An encrypted source is rejected because structure editing requires decrypted bytes
See Also