THotPDF.ApplyLoadedRedactions
Applies loaded Redact annotations to every painting category while removing intersecting text bytes
Delphi syntax
function ApplyLoadedRedactions( const PageRange: AnsiString= ''): Integer;
Description
The method collects /Subtype /Redact annotation rectangles on each selected page, normalizes their coordinates, and conservatively merges intersecting rectangles
An outer page rectangle and the merged redaction rectangles form an even-odd clipping path around the complete original page content. The clip therefore affects text, stroked and filled paths, images, Pattern paints, inline images, and Form XObjects at exact rectangle boundaries rather than dropping an entire painting operator
The clipping graphics state begins before the first page content stream and is restored after the last stream, preserving normal state continuity across a /Contents array. Opaque black overlays are painted only after that restore
Intersecting direct string operands and individual TJ string items are replaced with spaces in their original decoded streams. Glyph quadrilaterals are used for intersection, with a conservative text-origin fallback when exact geometry is unavailable
The return value is the number of direct string operands and TJ items blanked. A zero return can still mean non-text page graphics were successfully clipped
PageRange uses one-based page numbers and ranges. An empty value processes every page
See also Review-First Redaction Detection, RedactLoadedRect, and AddRedactAnnotation