Convert EPS files using .NET API
This article explains how to convert EPS files using C# on the example of EPS to BMP Conversion.
Aspose.Page lets you convert EPS files using C# in BMP, JPG, EMF, TIFF, PNG, WMF and PDF formats.
C# EPS to BMP Conversion
You can check the quality of Aspose.Page EPS to BMP conversion and view the results via free online EPS to BMP Converter, EPS Viewer and other other apps, to manipulate EPS files
Aspose.Page for .NET EPS converter allows to convert Encapsulated PostScript (EPS) 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 EPS to BMP conversion:
- Create an instance of PsDocument from EPS file.
- Use ImageSaveOptions(or PdfSaveOptions if you convert to PDF) to specify AdditionalFontsFolder and SuppressError boolean values.
- Save the PostScript document as an image with image save options to an array of arrays of bytes. One array of bytes for one page of input document.
- Save resulting 2-dimensional arrays of bytes to BMP files creating for every byte array a new file output stream.
- If the SuppressErrors value was true, as it is by default, It is possible to see what errors were thrown during the conversion of EPS to BMP.
Following C# code snippet shows how to convert EPS to BMP files in C#. All the other EPS conversions are fulfilled similarly.
Let’s consider ImageSaveOptions. Using this class we can assign different conversion parameters while converting EPS to BMP.
- Size specifies the resulting image width and height.
- ImageFormat specifies the output imagge format.
- SmoothingMode controls a quality of drawing curves, text and raster images in the resulting image.
- AdditionalFontsFolder specifies locations where to find fonts. System font folders are always included by default.
- SuppressError controls the behavior of EPS to BMP converter when non-critical errors are appeared. If the value is true then it is possible to view a list of such errors after conversion in the Exceptions field. The default value is true.
- Debug allows outputting debug information to the console. The default value is false.
Evaluate EPS conversion online on our EPS online Converter. You can convert several EPS files at once and download results in a few seconds.
You can download examples and data files from GitHub.