We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

RedactArea corrupts the PDF if I use Aspose License


I am using Aspose PDF for JAVA version 17.8. I am trying to use the redactArea method on the editor but it corrupts the PDF file.

  public static void main (String args[]) throws Exception {
    com.aspose.pdf.License license = new com.aspose.pdf.License();
    File file = new File("C:\\test.pdf");
    com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(file.getAbsolutePath());
    PdfAnnotationEditor editor = new PdfAnnotationEditor();
    editor.redactArea(1, new Rectangle(100, 100, 200, 70), java.awt.Color.BLUE);
    editor.save( "C:\\" + file.getName());

In the above code, if I comment out the line to add the license ( license.setLicense(“C:\Aspose.Total.Java.lic”)), it works fine but comes up with the watermark for Evaluation copy.
I have attached the 2 result files which I get after running the above code -

  1. With the above code as is (with the license) - result file with license.pdf (357.5 KB)
  2. With the above code after removing the line that adds the license - result file without license.pdf (182.0 KB)

My input file is - test.pdf (150.4 KB)

Can you please help me fix this. Please let me know if you need more details.


I have worked with the data shared by you and have been able to reproduce the issue on my end. A ticket with ID PDFJAVA-37232 has been logged into our issue management system for further investigation and resolution. This thread has been linked with the issue so that you may be notified automatically as soon as the issue will be resolved.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFJAVA-37232) have been fixed in Aspose.PDF for Java 18.4. This message was posted using BugNotificationTool from Downloads module by asad.ali