Free Support Forum -

Convert PostScript PS File to PDF Format using C# .NET API - Avoid Error Undefined | Aspose.Page

I am trying use Aspose Page to convert a PostScript file to PDF using the sample code provided. I get a “%%[Error: Undefined; Offending Command: ndefined” error when trying. I am wondering if there are certain options that I need to set to convert this file or if Aspose Page just can’t convert it.

I have attached the file below: (1.2 MB)


The C# code that we used to test your scenario of PostScript (PS) to PDF file conversion with the latest (20.9) version of Aspose.Page for .NET API is as follows:

Aspose.Page.License lic = new Aspose.Page.License();

System.IO.FileStream psStream = new System.IO.FileStream("", System.IO.FileMode.Open, System.IO.FileAccess.Read);
System.IO.FileStream pdfStream = new System.IO.FileStream("output.pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write);

PsDocument document = new PsDocument(psStream);

bool suppressErrors = true;
PdfSaveOptions options = new PdfSaveOptions(suppressErrors);
Aspose.Page.EPS.Device.PdfDevice device = new Aspose.Page.EPS.Device.PdfDevice(pdfStream);
    document.Save(device, options);

//Review errors
if (suppressErrors)
    foreach (PsConverterException ex in options.Exceptions)

Above code produces an empty PDF of 3 Kb file size. It also outputs the following error message to the Console window:

%%[Error: Undefined; Offending Command: ←]%%

Operand Stack (
[ ]

Execution Stack (
[ --file (pipe) -- ← //Undefined ]

Dictionary Stack (
[ --dictionary (357)-- --dictionary (0)-- --dictionary (0)-- ]

We will further look into the details of this problem and will keep you posted here on any further updates. We apologize for your inconvenience.


We have logged above mentioned issue as PAGENET-198 in our issue management system for the sake of correction. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.