This tutorial focuses on how to convert EPS to JPG in C#. It explains the API configuration, and the step-by-step algorithm followed by a runnable code snippet to let you test the feature to change EPS to JPG in C#. You only need to make a couple of API calls to process the input EPS file and render it to JPG image format.
Steps to Convert EPS to JPG using C#
- Install Aspose.Page library in your system to convert EPS files
- Initialize a FileStream class object to read the source EPS file
- Load the input EPS document using the PsDocument class
- Instantiate an object of ImageSaveOptions class to set image properties
- Create an image rendering device to render the JPG image
- Convert the EPS file to a JPG format document
The steps above summarize the information about how to transform EPS to JPG in C#. As mentioned in the first step, the API can easily be configured in your environment, and then proceed to read the input PostScript file in EPS format. Subsequently, set the image properties and render it in JPG format to achieve your requirements.
Code to Convert EPS to JPG in C#
This sample code can be used to process PostScript files in EPS format. First, load the input EPS file into a stream, then you can specify image quality, resolution, additional fonts folder, the flag to suppress the errors, and get the list of suppressed errors if any. Finally, create an image rendering device to export from EPS to JPG in C# while specifying the output file name.
This tutorial covers the details to convert EPS file to JPG in C#. Besides, if you are interested to explore XPS file to JPG image conversion, please read the article on how to convert XPS to JPG in C#.