Convert PCL / PS file to PDF in C# with Aspose.PDF API issue

Hi,

I need convert spool files of windows(PCL 6, PCL5, PS) to PDF.

Conventing one file PCL 6, i receive this exception:

System.SystemException: Invalid image block length: 7600, source width in bytes = 144, number of rows = 50, padBytesMutiple = 4, padding space = 0 —> System.ArgumentException: Invalid image block length: 7600, source width in bytes = 144, number of rows = 50, padBytesMutiple = 4, padding space = 0
em ? .( , Byte[] , Int32 , Int32, ? )
em ? . ?(Byte[] , Int32 , Int32 , ? , Boolean )
— Fim do rastreamento de pilha de exceções internas —
em ? . ?(Byte[] , Int32 , Int32 , ? , Boolean )
em ? . ?(Byte[] , Int32 , Boolean )
em ? .(Boolean )
em ? . ?(Boolean , Boolean )
em ? .? ?(Boolean )
em ? . ?()
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart()

When i try convert post script spool, is generated one PDF file empty.
I’m sending my test files to analyze.

Aspose.PDF has support to PostScript Files?Test_Files.zip (183.8 KB)

@magalhaesleo

Thank you for contacting Aspose Support.

This query is relevant to Aspose Native APIs so we may move your thread to http://forum.aspose.com/. Our Native APIs Support Team will shortly answer your query.

@magalhaesleo

Thank you for contacting support.

We would like to share with you that Aspose.PDF API currently supports PCL5 and older versions only. That is why the rendering of file fails with an exception. A ticket with ID PDFNET-44433 has been logged in our issue management system as a feature request for the same. However, 00018.SPL file is rendered fine. I have attached generated PDF file for your kind reference Test_18.3.pdf. Please request for a temporary license by following the instructions written over Get a Temporary License, and then convert the file by using below code snippet after Applying the license.

// Instantiate LoadOption object using PCL load option
PclLoadOptions loadoptions = new PclLoadOptions();
// Create Document object
Document doc = new Document( dataDir + "00018.SPL", loadoptions);
// Save the resultant PDF document
doc.Save( dataDir + "Test_18.3.pdf");

I hope this will be helpful. Please let us know if you need any further assistance.

This topic has been moved to the related forum: Convert Spool (PCL 6, PCL5, PS) files to PDF in C# with Aspose.PDF for .NET - Invalid image block length Error occurred - Free Support Forum - aspose.com

@magalhaesleo

Please note, We have also included PCL / PS files to PDF conversion support in Aspose.PDF Cloud API. Please check following API methods for detail. You can also use SDK of your favorite programming language in your application for the conversion, without worrying about underlying REST API Calls.

Convert PCL to PDF
Convert PS to PDF