Convert PostScript files using .NET
This article explains how to convert PS files using C# on the example of PS to PDF Conversion.
Aspose.Page lets you convert PS files using C# in BMP, JPG, TIFF, PNG, and PDF formats.
C# PS to PDF Conversion
You can check the quality of Aspose.Page PS to PDF conversion and view the results via free online PostScipt to PDF Converter, PS Viewer and other other apps, to manipulate PS files
Aspose.Page for .NET PS to PDF converter allows to convert PostScript (PS) file with of any language supported by .NET platform: C#, VB, J#. All the conversions are performed in a similar way to the one shown in the example below.
Steps to perform PS to PDF conversion:
- Create an instance of PsDocument from PS file.
- Use PdfSaveOptions(or ImageSaveOptions if you convert to an image format) to specify AdditionalFontsFolder and SuppressError boolean values.
- Create an instance of PdfDevice(or ImageDevice if you convert to an image format) from the created earlier output stream.
- Save PostScript document as PDF with PDF save options.
- If the SuppressErrors value was true, as it is by default, It is possible to see what errors were thrown during the conversion of PS to PDF and saved in the Exceptions list.
Let’s consider PdfSaveOptions. Using this class we can assign different conversion parameters while converting PS to PDF.
- Size specifies the size of the pages in resulting document.
- AdditionalFontsFolder specifies locations where to find fonts. System font folders are always included by default.
- SuppressError controls the behaviour of PS converter when non-critical errors appear. If the value is true then it is possible to view a list of such errors after the conversion in the Exceptions field. The default value is true.
- Debug allows outputting debug information to the console. The default value is false.
Also check PS conversion functionality online on our PS Converter. There you can convert several PS files at once and dowload results in a few seconds.
You can download examples and data files from GitHub.