Merge PS documents to PDF

C++ API solution to combine several PostScript files

 

PostScript file format can contain multiple pages, but it does not have the capability to combine multiple files into a single document like the XPS format. Aspose.Page API solution for C++ provides you with the functionality to merge several PS or EPS files into one PDF document.

The following code example demonstrates how to merge PostScript files using C++. If you need to learn how this functionality can be integrated into a web solution or to merge files online, you can try the cross-platform PS Merger tool.

To merge PS and EPS files, we need:

  • Aspose.Page for C++ API which is a feature-rich, powerful and easy to use document manipulation and conversion API for C++ platform.

  • You can download its latest version directly, just open NuGet package manager, and search for Aspose.Page.Cpp and install. You may also use the following command from the Package Manager Console.

Package Manager Console Command

    PM> Install-Package Aspose.Page.Cpp

Steps to merge PostScript files with C++

  1. Create an instance of PsDocument from the first PostScript file.
  2. Create an array of PS files that will be merged with the first one.
  3. Use PdfSaveOptions to specify AdditionalFontsFolder and SuppressError boolean value.
  4. Merge (by MergeToPdf ) PS files with the created document and save it as PDF with PDF save options.
  5. If the SuppressErrors value was true, as it is by default, It is possible to see what errors were thrown during the merging of PostScript files to a PDF document and saved in the Exceptions list.
Merge PS files to PDF

Merge Encapsulated PostScript files with C++

To merge EPS to PDF you will need to take the same steps as for PS to PDF merging. To learn a more detailed code example go to Aspose.Page Documentation .

PS What is PS File Format

PS format is one of the page description language (PDL) formats. It is capable to contain graphic as well as text information on the page. That is why the format was supported by most of the programs for image editing. The postscript file itself is a kind of instruction for printers. It contains information on what and how to print from its page.