I have an 18 page pdf document which I am attempting to convert to pdf-a using the following code.
try (final Document pdfDocument = new Document(inputFile.getAbsolutePath())) {
pdfDocument.convert(xmlPath + "/log.xml", PdfFormat.PDF_A_1A, ConvertErrorAction.Delete);
pdfDocument.save(outputFile.getAbsolutePath());
}
However, the conversion fails with a dimensions are too large message.
java.lang.IllegalArgumentException: Dimensions (width=515157446 height=514851337) are too large
at java.awt.image.SampleModel.<init>(Unknown Source) ~[?:1.8.0_65]
at java.awt.image.ComponentSampleModel.<init>(Unknown Source) ~[?:1.8.0_65]
at java.awt.image.PixelInterleavedSampleModel.<init>(Unknown Source) ~[?:1.8.0_65]
at java.awt.image.Raster.createInterleavedRaster(Unknown Source) ~[?:1.8.0_65]
at java.awt.image.Raster.createInterleavedRaster(Unknown Source) ~[?:1.8.0_65]
at java.awt.image.BufferedImage.<init>(Unknown Source) ~[?:1.8.0_65]
at com.aspose.pdf.internal.l182u.lj.lI(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l155n.lf.lI(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l155n.lf.<init>(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l10l.l0u.lI(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l10l.l0u.lt(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l10l.l0u.lI(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l10l.l0u.lj(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l10l.l0if.lv(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l10l.ly.lf(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l10l.l0if.l0t(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.internal.l10l.ly.lI(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.ADocument.lI(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.ADocument.convert(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.Document.convert(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.ADocument.convert(Unknown Source) ~[application.jar:?]
at com.aspose.pdf.Document.convert(Unknown Source) ~[application.jar:?]
at org.package.application.pdftransform.AsposePDFTransformer.ConvertPDFToPDFa1a(AsposePDFTransformer.java:19) ~[application.jar:?]
at org.package.application.pdftransform.AlfrescoPDFConvert.importSingleFile(AlfrescoPDFConvert.java:177) ~[application.jar:?]
at org.package.application.pdftransform.NodeRefFileProcessor.importSingleFile(NodeRefFileProcessor.java:237) [application.jar:?]
at org.package.application.pdftransform.NodeRefFileProcessor.processFileList(NodeRefFileProcessor.java:142) [application.jar:?]
at org.package.application.Monitor.importFileList(Monitor.java:116) [application.jar:?]
at org.package.application.Monitor.processFiles(Monitor.java:212) [application.jar:?]
at org.package.application.Monitor.processTree(Monitor.java:220) [application.jar:?]
at org.package.application.Monitor.runFileMonitor(Monitor.java:292) [application.jar:?]
at org.package.application.Monitor.run(Monitor.java:257) [application.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_65]
I am assuming that this is not caused by a large filesize or too many pages. How do I correct this? (in code, not by changing the pdf)
Some details about the pdf taken from adobe reader. I cannot share the pdf itself.
pdf details.PNG (4.3 KB)