Merge EPS files to PDF using .NET

You can check the quality of Aspose.Page EPS Merger and view the results via free online EPS Merger

Aspose.Page for .NET EPS Merger allows to merge Encapsulated PostScript (EPS) files to PDF document with using of any language supported by .NET platform: C#, VB, J#.
It is necessary to do several steps in order to perform EPS merge:

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


Following code snippet shows how to merge EPS files to PDF document in C#:

 1/ For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-.NET
 2// The path to the documents directory.
 3string dataDir = RunExamples.GetDataDir_WorkingWithDocumentMerging();
 4// Initialize PS document with the first EPS file
 5PsDocument document = new PsDocument(dataDir + "input.eps");
 6
 7// Create an array of PostScript files that will be merged with the first one
 8string[] filesForMerge = new string[] { dataDir + "input2.eps", dataDir + "input3.eps" };
 9
10// If you want to convert Postscript file despite of minor errors set this flag
11bool suppressErrors = true;
12
13//Initialize options object with necessary parameters.
14PdfSaveOptions options = new PdfSaveOptions(suppressErrors);
15// If you want to add special folder where fonts are stored. Default fonts folder in OS is always included.
16options.AdditionalFontsFolders = new string[] { @"{FONT_FOLDER}" };
17
18// Default page size is 595x842 and it is not mandatory to set it in SaveOptions
19// But if you need to specify the page size following line
20//PdfSaveOptions options = new PdfSaveOptions(suppressErrors, new Aspose.Page.Drawing.Size(595, 842));
21
22document.MergeToPdf(dataDir + "outputPDF_out.pdf", filesForMerge, options);
23
24//Review errors
25if (suppressErrors)
26{
27    foreach (Exception ex in options.Exceptions)
28    {
29        Console.WriteLine(ex.Message);
30    }
31}

See EPS merge in Java and C++.

Let’s consider PdfSaveOptions. Using this class we can assign different conversion parameters while merging EPS to PDF.

Evaluate EPS merging online on our EPS Merger.

You can download 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.