PCL -> PDF

Hi,


I have some PCL file to be converted to PDF file …
a but all tag are not translated

I’m in evaluation mode …

i’m using your sample

System.out.println(“PCL to PDF conversion performed started!”);
Pdf pdf1 = new Pdf();

// bind the source PCL file with Pdf object
pdf1.bindPCL(PCLFile);

// save the resultant PDF document
pdf1.save(PDFFile);

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

Did you have any solution for having the good result ?

Regard’s
Christophe





Hi Christophe,

Thanks for contacting support.

From your above statement, you are unable to see all comments in resultant file. The reason contents do not appear is because page contents are rendered beyond right page margin. In order to generate correct output, please increase page width. Please try using following code snippet.

[Java]

// Instantiate PCL load option
com.aspose.pdf.PclLoadOptions pcl = new com.aspose.pdf.PclLoadOptions();

// Load PCL file
com.aspose.pdf.Document document = new com.aspose.pdf.Document("c:/pdftest/GED_5011127F668283.pcl5", pcl);

// Iterate through pages inside PDF file
for (Page page : (Iterable<Page>) document.getPages())
{
    com.aspose.pdf.Rectangle r = page.getMediaBox();

    // New height the same
    double newHeight = r.getHeight();

    // New width is expanded proportionally to make orientation landscape (we assume that previous orientation is portrait)
    double newWidth = r.getHeight() * r.getHeight() / r.getWidth();

    double newLLX = r.getLLX();

    // We must move page upper in order to compensate changing page size 
    // (lower edge of the page is 0,0 and information is usually placed from the top of the page. 
    // That's why we move lower edge upper on difference between old and new height).
    double newLLY = r.getLLY() + (r.getHeight() - newHeight);

    page.setMediaBox(new com.aspose.pdf.Rectangle(newLLX, newLLY, newLLX + newWidth, newLLY + newHeight));

    // Sometimes we also need to set CropBox (if it was set in original file)
    page.setCropBox(new com.aspose.pdf.Rectangle(newLLX, newLLY, newLLX + newWidth, newLLY + newHeight));
}

// Save PDF document
document.save("c:/pdftest/LandScapeOutput.pdf");

For your reference, I have also attached the output generated over my end. In case you still face any issue or you have any further query, please feel free to contact.

HI,


Thank’s you for the sample …
But when i have added it in my eclipse …
and run it …

It’s take a longtime …and i have the following error message … just after the : com.aspose.pdf.Document
document =
new
com.aspose.pdf.Document

class com.aspose.pdf.internal.ms.System.z9: At most 4 text fragments can be added in evaluation mode.
com.aspose.pdf.TextBuilder.m1(Unknown Source)
com.aspose.pdf.TextBuilder.appendText(Unknown Source)
com.aspose.pdf.z7.m1(Unknown Source)
com.aspose.pdf.internal.foundation.rendering.z17.accept(Unknown Source)

This is a limitation of the eval product ?
How can i do for validating your product ?

Hi Christophe,


Thanks for sharing the details.

There is a limitation when using the API in trial mode. However in order to test the API without any limitations, you may consider requesting a 30 days temporary license. For more information, please visit How to send a license?