Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

PCL to PDF conversion does not work

$
0
0
Hello,

I'm testing your Aspose Java library (Aspose.Pdf for Java 9.3.1) with a temporary licence in order to convert a PCL file into PDF. I've used the testing file "test.pcl" you provided in your "Aspose_Pdf_Java-master" samples.

OS: Windows 7 Enterprise SP1 32 bits
JDK: jdk1.7.0_67
Lib: aspose-pdf-9.3.1-jdk16

Here is the code:

public class AsposeMainTest {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        String rootDir="C:\\";
        String pathFrom= rootDir + "test.pcl";
        String pathTo = rootDir + "output-test.pdf";
       
   
        System.out.println("Load licence");
       
        // create license object
        com.aspose.pdf.License license= new com.aspose.pdf.License();
        // load the license file into FileStream object
        try {
            license.setLicense(new java.io.FileInputStream("Aspose.Pdf.lic"));
        } catch (Exception e2) {
            // TODO Auto-generated catch block
            e2.printStackTrace();
        }

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

        System.out.println("Conversion of: " + pathFrom + " to: " + pathTo);
        // 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(pathFrom, loadoptions);
        // Save the resultant PDF document
        doc.save(pathTo);

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

    }

}


Here is the ouput:

Load licence
PCL to PDF conversion start!
Conversion of: C:\Users\M999EGF\Documents\PDF Conversion\PCLToPDF\test.pcl to: C:\Users\M999EGF\Documents\PDF Conversion\PCLToPDF\output-test.pdf
Exception in thread "main" com.aspose.pdf.internal.p230.z55: Unexpected font parsing exception
    at com.aspose.pdf.ADocument.m2(Unknown Source)
    at com.aspose.pdf.ADocument.m1(Unknown Source)
    at com.aspose.pdf.ADocument.<init>(Unknown Source)
    at com.aspose.pdf.Document.<init>(Unknown Source)
    at AsposeMainTest.main(AsposeMainTest.java:30
)



Thank you in advance for your help.

Regards,

Eric.

Viewing all articles
Browse latest Browse all 3131

Trending Articles