Free Support Forum -

Redaction is redacting strangely

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;

  1. sample_redaction.pdf - the marked up file ready to be redacted.
  2. redacted-sample_redaction.pdf - The redaction as applied via Aspose PDF.
  3. 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) {

				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 + outFile);<a class="attachment" 

Is there something we are missing that can correct this?

Bart Morse

href="/uploads/discourse_instance3/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)


Thanks for contacting support.

We have tried to redact the text from your document through both DOM and Facades approaches and noticed issue in the output file. We have logged the issue as PDFJAVA-37995 in our issue tracking system for further investigation. As soon as we make some progress towards its resolution, we will let you know. Please be patient and spare us little time.

We are sorry for the inconvenience.