Hi,
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();
license.setLicense("C:\\Aspose.Total.Java.lic");
File file = new File("C:\\test.pdf");
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(file.getAbsolutePath());
PdfAnnotationEditor editor = new PdfAnnotationEditor();
editor.bindPdf(pdfDocument);
editor.redactArea(1, new Rectangle(100, 100, 200, 70), java.awt.Color.BLUE);
editor.save( "C:\\" + file.getName());
editor.close();
pdfDocument.close();
}
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 -
- With the above code as is (with the license) - result file with license.pdf (357.5 KB)
- 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.