ASPose.pdf Java ArrayIndexOutOfBounsException

Hello,

I need to programmatically flatten(burn-in) the annotations(including Redact). This particular PDF was given the “Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 475200” error.

  1. We are using PDFTron to manipulate the PDF on the browser GUI.
  2. There are 2 PDF source documents with multiple annotations respectively.
  3. I use the ASPose.PDF java to import the annotation xFDFS to those 2 PDF documents.
  4. I use Adobe AEM/Assembler to merge the 2 PDFs into one MashUp-ed document.
  5. I use the ASPose.PDF java PDFAnnotationEditor.flattenAnnotations and the MashUp-ed document to burn-in those annotations.
  6. It throws error at this method flattenAnnotations.

The library I am using is aspose-pdf-21.2.1-jdk16.jar. This is what PDFTron is using in our env.

Any help is very much appreciated.
Thanks,
Anthony

@kuohuei8aspose,

Can you share the Pdf document and the code snippet, please?

Carlos,

Thanks for your quick response. The email notification has gone to my spam. Just saw your response.

Here are the code snippet and the error I got.

void test_ASPoseBurnInRedact() {
String sPdf_P = “RedactionDataset\redact_mark_090511b3800711e3.pdf”;
String oPdf_P = “RedactionDataset\output_jdk8_burnin.pdf”;
PdfAnnotationEditor editor = new PdfAnnotationEditor();
editor.bindPdf(sPdf_P);
editor.flatteningAnnotations(); // failed at this point with errors.
editor.save(oPdf_P);
debugOut(“done”);
}

error I was getting
Current JVM version - 1.8.0_251
0 [main] DEBUG SOMS.ASPoseUtils - version: 0.1
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 475200
at com.aspose.pdf.Redaction.lI(Unknown Source)
at com.aspose.pdf.Redaction.lI(Unknown Source)
at com.aspose.pdf.RedactionAnnotation.redact(Unknown Source)
at com.aspose.pdf.ADocument.l2t(Unknown Source)
at com.aspose.pdf.ADocument.flatten(Unknown Source)
at com.aspose.pdf.Document.flatten(Unknown Source)
at com.aspose.pdf.ADocument.flatten(Unknown Source)
at com.aspose.pdf.Document.flatten(Unknown Source)
at com.aspose.pdf.facades.PdfAnnotationEditor.flatteningAnnotations(Unknown Source)
at gov.cdcr.eRMSX.AEM.ASPoseUtilsImpl.test_ASPoseBurnInRedact(ASPoseUtilsImpl.java:157)
at gov.cdcr.eRMSX.AEM.ASPoseUtilsImpl.main(ASPoseUtilsImpl.java:38)

Here is the source PDF with multiple annotations.
redact_mark_090511b3800711e3.pdf (226.8 KB)

Thanks,
Anthony

@kuohuei8aspose,

I was able to replicate the issue. I will create a bug for the dev team.

@kuohuei8aspose
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54333

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Carlos,

I will read through the “Free Support Policies” and the “Paid Support Services”.

As for the issue fix, without paid support, what is the ETA?

Thanks,
Anthony

@kuohuei8aspose,

I have no idea because I am not part of the dev team or have any input on their priorities.

From what I have seen when it is a critical bug that is affecting many users, it gets solved faster(sometimes there is a new release in the middle of the month), but when it is very niche, it takes longer. How much longer I cannot say but much longer.

Sorry I cannot provide you with the exact times but I cannot because it does not depend on me.

Carlos,

No problem.

Thanks,
Anthony

The issues you have found earlier (filed as PDFNET-54333) have been fixed in Aspose.PDF for .NET 23.9.