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

Free Support Forum - aspose.com

PCL to Image using Aspose.PDF v 20.9

We are trying to evaluate whether the Aspose.PDF library will work to convert customer PCL files to image (PNG/JPEG/TIFF). We are using Aspose.PDF v 20.9 from NuGet in Visual Studio and are following the instructions outlined on your site.

// load the PCL file to be converted
var document = new Aspose.Pdf.Document("My File.pcl");
// save PCL as a JPEG
document.Save("Saved File.jpeg", Aspose.Pdf.SaveFormat.Jpeg);  

However, we get this compile error:

'SaveFormat' does not contain a definition for 'Jpeg'

When we try output as PDF format instead of JPEG, the following error is thrown at runtime:

Exception thrown: 'Aspose.Pdf.InvalidPdfFileFormatException' in Aspose.PDF.dll

The PCL files we are testing with work with other PCL viewers and printers. Is PCL no longer supported in version 20.9? Do we need to have purchased a license to either load PCL files or to use the output to image option? Is there something else we have overlooked?

Thank you for your help in evaluating this library.

@bdev

You need to specify PclLoadOptions while loading the PCL file in Document(). Please check following documentation article for more information:

Once a document is initialized successfully, you can convert the PDF pages into images further. In case you still face any issue, please share your sample PCL file with us so that we can test the scenario in our environment and address it accordingly.

Thank you, the links you provided allowed me to get the code to compile.

1 Like