How to Convert XLSX to PDF using Node.js

This short tutorial guides on how to convert XLSX to PDF using Node.js. It has all the details to set the IDE for using Aspose.Cells for Node.js via Java, the program flow in terms of steps, and a runnable sample code to convert XLSX file to PDF using Node.js. An introduction to the customization of the PDF is also provided before generating the output.

Steps to Change XLSX to PDF using Node.js

  1. Set the environment to use Aspose.Cells for Node.js via Java to change XLSX to PDF
  2. Load the sample XLSX file into the workbook class object
  3. Create an object of PdfSaveOptions class to customize the output PDF file
  4. Call the save() method of the Workbook class to create a PDF file in Node.js

These steps summarize the process to export XLSX to PDF using Node.js. The process is commenced by loading the source Excel file into the Workbook class object followed by the initialization of the PdfSaveOptions class object. Finally, the save() method from the Workbook class is used by providing the output PDF file name and the PdfSaveOptions object for the desired customizations.

Code to Convert XLSX into PDF using Node.js

The aforementioned sample code demonstrates the process to convert XLSX to PDF using Node.js. You may improvise the code by removing the initialization of the PdfSaveOptions and usage of this object in the save() method. The PdfSaveOptions can be used to set a lot of properties like setAllColumnsInOnePagePerSheet(), setBookmark(), setCalculateFormula(), setCreatedTime(), and setCustomPropertiesExport() to name a few.

This article has explained the process to transform a file from XLSX to PDF using Node.js. If you want to learn the process to convert an Excel file to CSV, refer to the article on how to convert Excel to CSV using Node.js.

 English