Merge PS/EPS files to PDF using Node.js
You can check the quality of Aspose.Page PS/EPS merging and view the results via free online PS Merger or EPS Merger
Aspose.Page for Node.js via C++ PS/EPS merger allows merging Encapsulated PostScript (EPS) files to a PDF document on Windows and Linux.
It is necessary to do one step to perform the PS/EPS to PDF merge:
- Call AsposePSMergeToPdf and pass the array of file names, the result file name, and SuppressError boolean values to it.
The result JSON contains the file name in fileNameResult.
If the SuppressErrors value was true, as it is by default, it is possible to see what errors were thrown during the merge of EPS to PDF.
The following code snippet shows how to merge EPS files into PDF document in NodeJS:
1const AsposePage = require('asposepagenodejs');
2
3const ps_files = "./data/program_01.ps,./data/PAGENET-361-10.eps";
4
5console.log("Aspose.Page for Node.js via C++ examples.");
6
7AsposePage().then(AsposePageModule => {
8
9 //PSMergeToPdf - convert to postscript to image
10 const JSON = AsposePageModule.AsposePSMergeToPdf(ps_files,"PsMergedToPdfResult.pdf",true);
11 console.log("PSMergeToPdf => %O", JSON.errorCode == 0 ? JSON.fileNameResult : JSON.errorText);
12},
13 reason => {console.log(`The unknown error has occurred: ${reason}`);}
14);
Let’s consider some parameters.
- SuppressError controls the behaviour of the EPS to PDF merger when non-critical errors appear. If the value is true, then it is possible to view a list of such errors after merging in the Exceptions field. The default value is true.
Evaluate EPS merging online on our EPS Merger.
You can download examples and data files from GitHub.