Convert EPS with Aspose.Page JavaScript via C++ API
This article explains how to convert EPS files using C++ on the example of EPS to WMF Conversion.
Aspose.Page for JavaScript via C++ lets you convert EPS files via Java in BMP, JPG, EMF, TIFF, PNG, WMF and PDF formats.
- JavaScript EPS to JPG
- JavaScript EPS to BMP
- JavaScript EPS to PNG
- JavaScript EPS to TIFF
- JavaScript EPS to PDF
You can check the quality of Aspose.Page EPS to PNG conversion and view the results via free online EPS to PNG Converter or EPS Viewer
Aspose.Page for JavaScript via C++ EPS to PNG converter allows to convert Encapsulated PostScript (EPS) file to PNG image on Windows and Linux.
It is necessary to call AsposePSSaveAsImage to perform EPS to PNG conversion:
- Create file reader ‘const file_reader = new FileReader();’ and read file ‘file_reader.readAsArrayBuffer(e.target.files[0]);’.
- On load event handler call AsposePSSaveAsImage and pass the file content and its name, image format Module.ImageFormat.Png and SuppressError boolean values to it.
- The result JSON contains the count of files in countFiles and the array of file names in filesNameResult. One file for one page of the input document.
- 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 PNG.
- You can download files by using the DownloadFile function: ‘for (let fileIndex = 0; fileIndex < JSON.filesCount; fileIndex++) DownloadFile(JSON.filesNameResult[fileIndex], “image/png”);’
The following code snippet shows how to convert EPS to PNG files in JavaScript:
For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-JavaScript-C
Let’s consider some parameters.
- SuppressError controls the behavior of the EPS to image converter when non-critical errors appear. 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.
Evaluate EPS to PNG conversion online on our EPS to PNG Converter. You can convert several EPS files to PNG at once and download the results in a few seconds.
You can download examples and data files from GitHub.