You can use PageAreaRedaction to redact an area of a specific page range from all sensitive data in text, images and annnotations.
The following example demonstrates how to apply PageAreaRedaction to the right half of the last page in a PDF document.
finalRedactorredactor=newRedactor("Sample.pdf");try{java.util.regex.Patternrx=java.util.regex.Pattern.compile("urna");ReplacementOptionsoptionsText=newReplacementOptions("[redarea]");optionsText.setFilters(newRedactionFilter[]{newPageRangeFilter(PageSeekOrigin.End,0,1),// last page
newPageAreaFilter(newjava.awt.Point(300,0),newjava.awt.Dimension(300,840))// right half of the page
});RegionReplacementOptionsoptionsImg=newRegionReplacementOptions(java.awt.Color.RED,newjava.awt.Dimension(100,100));RedactorChangeLogresult=redactor.apply(newPageAreaRedaction(rx,optionsText,optionsImg));if(result.getStatus()!=RedactionStatus.Failed){redactor.save();}}finally{redactor.close();}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.