I am trying to convert a ps file to a pdf and getting the error shown above.
Here is my code
var input = "UCM21161714.ps";
var output = "UCM21161714.pdf";
var psStream = new System.IO.FileStream(input, System.IO.FileMode.Open, System.IO.FileAccess.Read);
// initialize PDF output stream
var pdfStream = new System.IO.FileStream(output, System.IO.FileMode.Create, System.IO.FileAccess.Write);
// read PS file
var document = new PsDocument(psStream);
// create a device for output steram
var device = new PdfDevice(pdfStream);
try
{
var options = new PdfSaveOptions();
options.SupressErrors = false;
document.Save(device, options);
}
finally
{
psStream.Close();
pdfStream.Close();
}
file.zip (433.4 KB)
If i set supress errors to true then the document only generates part of the actual ps document.