Convert PostScript with Aspose.Page C++ API

This article explains how to convert PS files using C++ on the example of PS to BMP Conversion.

Aspose.Page lets you convert PS files using Java in high-quality BMP, JPG, TIFF, PNG, and PDF documents.

You can check the quality of Aspose.Page PS to BMP conversion and view the results via free online PostScipt to BMP Converter or PostScript Viewer

Aspose.Page for C++ PS to BMP converter allows to convert PostScript (PS) file to BMP image on Windows and Linux.

It is necessary to take several steps for PS to BMP conversion:

  1. Create an instance of PsDocument from PS file.
  2. Use PdfSaveOptions(or ImageSaveOptions if you convert to an image format) to specify AdditionalFontsFolder and SuppressError boolean values.
  3. Call SaveAsImage to save PostScript document as image with image save options ( or call SaveAsPdf to save PostScript document as PDF with PDF save options) to an array of arrays of bytes. One array of bytes for one page of input document.
  4. Save resulting 2-dimensional arrays of bytes to PNG files creating for every byte array a new file output stream.
  5. If the SuppressErrors value was true, as it is by default, It is possible to see what errors were thrown during the conversion of PS to PDF and saved in the Exceptions list.

The following code snippet shows how to convert PS to BMP files in C++:

                
            

For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-C

See PS to BMP conversion in .Net and Java.

Let’s consider ImageSaveOptions. Using this class we can assign different conversion parameters while converting PS to BMP.

Have a look at PS online conversion in our PS cross-platform Converter. You can convert several PS files to BMP at once and download results in a few seconds.

Feel free download the examples and data files from GitHub.

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.