I am using com.aspose.pdf in order to convert an image to a pdf. The problem is that the resulting pdf is broken.
The versin of aspose-pdf is 11.8.0
The code that I am using looks like this:
LicenseLoader licenseLoader = LicenseLoader.getInstance();
com.aspose.pdf.Image image = new com.aspose.pdf.Image();
com.aspose.pdf.Document doc = new com.aspose.pdf.Document();
ByteArrayOutputStream pdfStream = new ByteArrayOutputStream();
All the files used are added as attachment. The original image that I am using is named “testdoc.png”. The result pdf is named “testdoc.png.pdf” and the signed pdf is named “testdoc.pngSigned.pdf”.
If you open “testdoc.pngSigned.pdf” in acrobat reader, you will notice that a signature field is broken. After investigation on our side, we found out the cause:
- the problem is that “testdoc.png.pdf” contains 2 subsections.
See PDF specifications ISO 32000-1:2008(http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf) section 7.5.4: "For a file that has never been incrementally updated, the cross-reference section shall contain only one subsection"
The converted pdf(“testdoc.png.pdf”) contains 2 subsections. This has severe consequences on our product because signing results in broken signature fields, making the usage of aspose-pdf meaningless. This is a critical problem for our product.
Please let me know if there is anything unclear or if there are any updates on this.
We will test the scenario and will reply accordingly.