Merge XPS documents to PDF

Node.js API solution to combine several XPS files into a single PDF file

 

Merging XPS (XML Paper Specification) files into a single PDF document offers significant benefits, primarily centered around universal accessibility, enhanced functionality, and streamlined document management. While XPS is a Microsoft-developed fixed-layout document format with some similarities to PDF, PDF remains the more widely adopted and feature-rich standard for general document exchange. Aspose.Page API Solution for Node.js offers the ability to merge multiple files into one, resulting in an XPS or PDF file that contains the combined content of all the original files.

Here you will find a code example of how to use the API for merging XPS files. To explore how this functionality can be integrated into a web solution or used for online file merging, you can try out the cross-platform XPS Merger tool.

To merge XPS files, you need:

Steps to merge several XPS files into a single file with Node.js.

  1. Include Aspose.Page for Node.js library: ‘const AsposePage = require(‘asposepagenodejs’);’
  2. Call AsposeXPSMergeToXps and pass the array of file names, the result file name, and SuppressError boolean values to it.
  3. 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 XPS files.
Merge several XPS to single

Steps to merge several XPS files to PDF with Node.js.

  1. Include Aspose.Page for Node.js library: ‘const AsposePage = require(‘asposepagenodejs’);’
  2. Call AsposeXPSMergeToPdf and pass the array of file names, the result file name, and SuppressError boolean values to it.
  3. 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 XPS files.
Merge XPS to PDF

XPS What is XPS File Format

XPS (XML Paper Specification) is Microsoft’s open‑source alternative to PDF. It uses XML/HTML markup to describe page layout, fonts, and images, ensuring consistent rendering across Windows platforms and other operating systems.