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

Free Support Forum - aspose.com

OutOfMemoryError when loading PCL document

Hello,

I am currently evaluating Aspose.Pdf for Java to see whether it is suitable for our need to convert PCL documents to PDF. I am attempting to use a code snippet based on that in the documentation here: http://www.aspose.com/docs/display/pdfjava/Convert+PCL+File+to+PDF

public static void main(String… args) {
// Instantiate LoadOption object using PCL load option
com.aspose.pdf.PclLoadOptions loadoptions = new com.aspose.pdf.PclLoadOptions();
// Create Document object
com.aspose.pdf.Document doc = new com.aspose.pdf.Document(“C:\PCL\NOTE.pcl”, loadoptions);
// Save the resultant PDF document
doc.save(“C:\PCL\NOTE.pdf”);
}

However, this results in a long delay, eventually followed by OutOfMemoryError at the second line:

Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
at com.aspose.pdf.internal.p234.z11.m1(Unknown Source)
at com.aspose.pdf.internal.p352.z5.m2(Unknown Source)
at com.aspose.pdf.internal.p233.z13.m4(Unknown Source)
at com.aspose.pdf.internal.p233.z13.m2(Unknown Source)
at com.aspose.pdf.internal.p233.z13.m1(Unknown Source)
at com.aspose.pdf.internal.p233.z13.m1(Unknown Source)
at com.aspose.pdf.internal.p234.z10.a(Unknown Source)
at com.aspose.pdf.internal.p234.z10.b(Unknown Source)
at com.aspose.pdf.internal.p234.z10.a(Unknown Source)
at com.aspose.pdf.internal.p234.z10.set_Item(Unknown Source)
at com.aspose.pdf.internal.p188.z33.m1(Unknown Source)
at com.aspose.pdf.internal.p189.z4.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z1.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z28.m10(Unknown Source)
at com.aspose.pdf.internal.p188.z28.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z28.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z11.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z11.m2(Unknown Source)
at com.aspose.pdf.internal.p188.z11.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z8.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z10.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z10.m1(Unknown Source)
at com.aspose.pdf.internal.p188.z10.m1(Unknown Source)
at com.aspose.pdf.internal.p381.z13.m2(Unknown Source)
at com.aspose.pdf.internal.p385.z10.(Unknown Source)
at com.aspose.pcl.composer.PDFComposer.(Unknown Source)
at aspose.pdf.Pdf.bindPCL(Unknown Source)
at com.aspose.pdf.ADocument.m1(Unknown Source)
at com.aspose.pdf.ADocument.(Unknown Source)
at com.aspose.pdf.Document.(Unknown Source)

The PCL file in question (attached, in a zip file) is only 3Kb.

I am using aspose-pdf-9.5.0-jdk16.jar, and have also tried the jdk14 jar as well, and also tried a number of other sample PCL files with the same result.

Could you advise, please?

Many thanks.

Hi Rob,


Thanks for your inquiry. I have tested the scenario at my end using Aspose.Pdf for .NET 9.5.0 with JDK 1.6 with following heap size and unable to replicate the issue.Please increase the java heap size, it will help you to accomplish the task.

-Xms512m
-Xmx2048m

Please feel free to contact us for any further assistance.

Best Regards,