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

Free Support Forum - aspose.com

PCL to PDF conversion

Hi

For a project I'm planning to convert PCL file to PDF through Aspose licenced version. But before purchasing the licence I want to check the functionality of the Aspose PCL to PDF converter. So I have downloaded the evalution version aspose-pdf-11.4.0-java and tried to convert the PCL file to PDF. But I'm getting a java.lang.NullPointerException which I can't explain.

Can you let me know what it is what I'm doing wrong? I attached my PCL file to this thread and the code I'm using for Converting PCL to PDF is:

String dataDir = "C:\\Mendix\\TGKapp-main\\deployment\\data\\tmp\\";

String inputFile = "DJB.R41GN1.SE.PCL5C";

// Instantiate PDF object

Pdf pdf1 = new Pdf();

try {

// bind the source PCL file with Pdf object\

pdf1.bindPCL(dataDir + inputFile);

// save the resultant PDF document

pdf1.save(dataDir + "test-converted.pdf");

System.out.println("PCL to PDF conversion performed successfully!");

} catch (ExceptionInInitializerError e){

System.out.println(e.getException());

}

Thanks in advance

Gerard Heemskerk

Hi Gerard,


Thanks for your inquiry. Please use new DOM(com.aspose.pdf) approach for PCL to PDF conversion. I have tried the conversion with Aspose.Pdf for Java 11.4.0 and unable to notice the reported exception. Please find attached sample output.

Please feel free to contact us for any further assistance.

Best Regards,

Hi Tilal,


Thanks for your reply…
I don’t really understand what you mean with “Use the new DOM approach”.
Could you send me the code you used for the conversion?

Thanks in advance!

Best regards,

Gerard

Hi Gerard,


The code snippet which you have shared in your first post is based on legacy aspose.pdf package and in order to generate correct output, you need to try using code snippet specified over PCL to PDF conversion based on new Document Object Model of com.aspose.pdf package.

In the event of any further query, please feel free to contact.

Hi Nayyer,


I found out the conversion was not working for me. It is because I’m trying to approach the PCL to PDF conversion with the Mendix App platform.

I tried it in a empty Java project and now its working.

Thanks for your help.

Hi Gerard,


Thanks for your feedback. It is good to know that you have managed to accomplish your requirements with new DOM approach of PCL to PDF conversion.

Please keep using Aspose.Pdf for Java and feel free to contact us for any further assistance, we will be more than happy to extend our support.

Best Regards,