You can combine PageRangeFilter and PageAreaFilter filters in one set in order to set the scope of redaction to an area on a specific page. You have to set an array of instances to Filters property of the ReplacementOptions.
The following example demonstrates how to apply redaction to the bottom half of the last page in a PDF document.
finalRedactorredactor=newRedactor("Sample.pdf");try{// Get the actual size information for the last page:
IDocumentInfoinfo=redactor.getDocumentInfo();PageInfolastPage=info.getPages().get(info.getPageCount()-1);ReplacementOptionsoptions=newReplacementOptions("[secret]");options.setFilters(newRedactionFilter[]{newPageRangeFilter(PageSeekOrigin.End,0,1),newPageAreaFilter(newjava.awt.Point(0,lastPage.getHeight()/2),newjava.awt.Dimension(lastPage.getWidth(),lastPage.getHeight()/2))});RedactorChangeLogresult=redactor.apply(newExactPhraseRedaction("bibliography",false,options));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.