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

Free Support Forum - aspose.com

StackOverflow on Aspose.Pdf 4.1.2/4.2.0

Hello there,

we are encountering StackOverflows on the latest version of Aspose PDF. I have attached an example document to be able to reproduce the issue.

Thanks in advance

Rennicke

SystemInfo is:

JVM
Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM version 23.25-b01
Version 1.7.0_25
Vendor Oracle Corporation
Uptime 3 hours 17 minutes
Total compile time 9.927 seconds
Threads
Live threads 65
Daemon threads 45
Peak 305
Total started 377
Memory
Current heap size 143,152 kbytes
Maximum heap size 466,048 kbytes
Committed heap size 213,440 kbytes
Pending objects 0
Garbage collector Name = 'PS Scavenge', Collections = 22, Time = 0.212 seconds
Garbage collector Name = 'PS MarkSweep', Collections = 4, Time = 0.452 seconds
Classes
Current classes loaded 7,225
Total classes loaded 7,257
Total classes unloaded 32
Operating system
Name Windows 7 version 6.1
Architecture amd64
Processors 8

Stacktrace is:

java.lang.StackOverflowError
at com.aspose.pdf.OperatorCollection$a.(Unknown Source)
at com.aspose.pdf.OperatorCollection.iterator(Unknown Source)
at com.aspose.pdf.OperatorCollection.iterator(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)
at com.aspose.pdf.Page.a(Unknown Source)

Simple fast example Code here: Simple fast example Code here:

String fileNameTestFile="testdata/asposePdfNPEOnOptimizeResources/1.pdf";
InputStream inTestFile = new FileInputStream(findFile(fileNameTestFile));
OutputStream os = null;

com.aspose.pdf.Document pdfDocument = null;

File tempFile = File.createTempFile("Test-", ".pdf");
tempFile.deleteOnExit();
os = new FileOutputStream(tempFile);

pdfDocument = new com.aspose.pdf.Document(inTestFile);
pdfDocument.optimize();
pdfDocument.optimizeResources();
pdfDocument.save(os);

Hi Helge,


Sorry for the inconvenience faced. I’ve managed to reproduce
the reported issues on my side and logged the issue in our bug tracking system
for further investigation and resolution, the issue ID is PDFNEWJAVA-33732.
I’ve also linked your request to this issue and you will be notified via this
forum thread as soon as it is resolved.

Please feel free to contact us for any further assistance.

Best Regards,

<o:p></o:p>

Hi Helge,


Thanks for your patience. Please note your above reported issue has been fixed in Aspose.Pdf for Java 9.7.0 in result of some other fix. Please download and try latest version of Aspose.Pdf for Java it will help you to accomplish the task.

Please feel free to contact us for any further assistance.

Best Regards,