We have been working with the redaction features in Aspose PDF and although it generally works it is performing the redaction differently to Adobe. The three files are;
- sample_redaction.pdf - the marked up file ready to be redacted.
- redacted-sample_redaction.pdf - The redaction as applied via Aspose PDF.
- sample_redaction_Redacted.pdf - The redaction as applied by Adobe XI
com.aspose.pdf.Document pdf = new com.aspose.pdf.Document(directory + inFile);
for (int i = 1; i <= pdf.getPages().size(); i ++) {
int redactionCount = 0;
for (int j = 1; j <= pdf.getPages().get_Item(i).getAnnotations().size() ; j++) {
Annotation annotation = pdf.getPages().get_Item(i).getAnnotations().get_Item(j);
if (annotation.getAnnotationType() == AnnotationType.Redaction) {
redactionCount++;
RedactionAnnotation ra = (RedactionAnnotation)annotation;
Rectangle rect_to_redact = ra.getRectangle(false);
// Method 2
PdfAnnotationEditor redactor = new PdfAnnotationEditor(pdf);
redactor.redactExactArea(i, rect_to_redact, Color.BLACK);
}
}
System.out.println("Page = " + i + " - redaction count = " + redactionCount);
}
// save the redacted PDF
pdf.save(directory + outFile);<a class="attachment"
Is there something we are missing that can correct this?
Regards
Bart Morse
href="/uploads/default/18780">sample_redaction_Redacted.pdf (107.1 KB)
redacted-sample_redaction.pdf (107.5 KB)
sample_redaction.pdf (109.8 KB)
sample_redaction_Redacted.pdf (107.1 KB)