In this simple topic, we will focus on how to convert Excel to XPS using Node.js. XPS is a document sharing format similar to PDF and is commonly used for multiple purposes. In order to generate XPS from Excel in Node.js, we will use the application in any of Node.Js supported environments inside Windows, Java, or macOS.
Steps to Convert Excel to XPS in Node.js
- Set the development environment to use Aspose.Cells for Node.js via Java to convert Excel to XPS
- Apply the API license
- Access the source Excel file from the disk using an instance of the Workbook class
- Save the loaded Excel file as XPS on the disk
By following the above mentioned steps one can easily develop a converter to export an Excel to XPS in Node.js using a few lines of code. The process will commence by loading the source Excel file from the disk using an instance of the Workbook class. Then by using the save method, the loaded XLSX file is converted to an XPS by providing the save format.
Code to Generate XPS from Excel in Node.js
The above example entails the process to convert Excel to XPS in Node.js The XpsSaveOptions class can be used that can help to further customize the output XPS by setting options like default font, set gridline type, page indices, set pages per sheet, etc. to name the few.
In this topic, we have learned how Node.js convert Excel to XPS using a very simple API interface. If you are interested in learning about converting an Excel file to CSV, refer to the article on how to convert Excel to CSV using Node.js.