Here, for example, is our sample code for performing redactions on various pages of a PDF document:
https://www.pdftron.com/pdfnet/samplecode.html#PDFRedact
To perform the same redaction on each page would be as simple as:
PDFDoc
doc((input_path + "newsletter.pdf").c_str());
doc.InitSecurityHandler();
vector<Redactor::Redaction>
vec;
int page_num =
doc.GetPageCount();
for (int i=1; i<=page_num;
++i)
vec.push_back(Redactor::Redaction(i,
Rect(100, 100, 550, 600), false, "Top Secret"));
Redactor::Appearance
app;
app.RedactionOverlay =
true;
app.Border = false;
app.ShowRedactedContentRegions
= true;
Redact(input_path +
"newsletter.pdf",
output_path + "redacted.pdf", vec, app);
The redactor also supports concept of 'negative' redactions and this may be relevant to your batch processing mode. A document based negative redaction expand beyond the single page to automatically remove content from other pages in the document.
Once you have the bounding boxes, you can pass those in to Redactor as the coordinates of the redacted region.
Q:
Does Redactor just place a box over the text OR does it permanently replace the text with the
box?
It is important that the user cannot use any sort of PDF annotation program to remove the redacted box and see the text EVER after the redaction is complete.
---------
A:
The Redactor completely removes the redacted
region from the PDF content, including text, vector content, images, and
annotations. It does NOT simply add an annotation or image mask over the
content. Once PDFNet redacts the content, the content is erased from the
document.