Convert EPS files using API for Java
This article explains how to convert EPS files using Java on the example of EPS to PDF Conversion.
Aspose.Page lets you convert EPS files via Java in BMP, JPG, EMF, TIFF, PNG, WMF and PDF formats.
- Java EPS to JPG
- Java EPS to BMP
- Java EPS to PNG
- Java EPS to TIFF
- Java EPS to EMF
- Java EPS to WMF
- Java EPS to PDF
Java EPS to BMP Conversion
You can check the quality of Aspose.Page EPS to PDF conversion and view the results via free online EPS to PDF Converter
Aspose.Page for Java EPS to PDF converter allows to convert Encapsulated PostScript (EPS) file to PDF document on any OS for which Java Virtual Machine exists.
It is necessary to do several steps in order to perform EPS to PDF conversion:
- Create an instance of PsDocument from EPS file.
- Use PdfSaveOptions(or ImageSaveOptions if you convert to an image format) to specify ImageFormat, Size, AdditionalFontsFolder and SuppressError 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 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 and saved in Exceptions list.
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 Converter. You can convert several EPS files instantly and dowload results in a few seconds.
You can download examples and data files from GitHub.