Convert EPS with Aspose.Page C++ API
This article explains how to convert EPS files using C++ on the example of EPS to WMF Conversion.
Aspose.Page for C++ lets you convert EPS files via Java in BMP, JPG, EMF, TIFF, PNG, WMF and PDF formats.
You can check the quality of Aspose.Page EPS to WMF conversion and view the results via free online EPS to WMF Converter or EPS Viewer
Aspose.Page for C++ EPS to WMF converter allows to convert Encapsulated PostScript (EPS) file to WMF image on Windows and Linux.
It is necessary to do several steps to perform EPS to WMF conversion:
- Initialize an input stream for the input EPS file.
- Create an instance of PsDocument from created earlier input stream.
- Use ImageSaveOptions(or PdfSaveOptions if you convert to PDF) to specify AdditionalFontsFolder and SuppressError boolean value.
- Create an instance of ImageDevice(or PdfDevice if you convert to PDF) specifying image type and size if it is necessary.
- 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 WMF 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 WMF.
The following code snippet shows how to convert EPS to WMF files in C++:
For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-C
Let’s consider ImageSaveOptions. Using this class we can assign different conversion parameters while converting EPS to WMF.
- AdditionalFontsFolder specifies locations where to find fonts. System font folders are always included by default.
- SuppressError controls the behavior of EPS to WMF 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.
- Debug allows outputting debug information to the console. The default value is false.
Evaluate EPS to WMF conversion online on our EPS to WMF Converter. You can convert several EPS files to WMF at once and download results in a few seconds.
You can download examples and data files from GitHub.