This short tutorial guides how to add new page in PDF with Node.js REST API. You will learn to add a new page in PDF with Node.js Low Code API using the Node.js-based Cloud SDK. Once you add a new page online, you will learn to download and save the output on the disk.
Prerequisite
- Create an account API credentials
- Download Aspose.PDF Cloud SDK for Node.js
- Setup Node.js project with the above SDK for adding a page
Steps to Insert New Page in PDF with Node.js-based API
- Configure the client ID and secret in the PdfApi for adding a page
- Upload the source PDF file where an empty page is to be added
- Call the PutAddNewPage() with the uploaded PDF file name in the cloud storage
- Download the modified PDF file that has an empty page at the end and save it on the disk
These steps define the process to add extra page in PDF with Node.js RESTful Service. Initialize the PdfApi object, load the target PDF file to outline Cloud storage, and call the PutAddNewPage() method to add an empty page. Next, download the output PDF file stream and save it on the disk.
Code to Insert New Page Into PDF with Node.js RESTful Service
The above code demonstrates how to add another page in PDF with Node.js-based API. You can add as many pages as required by calling the PutAddNewPage() multiple times. Use the same name to download the output PDF file from the online storage that you have used to upload the source PDF file using the UploadFile().
This article has guided us to add new pages to PDF with Node.js REST Interface. If you want to append a PDF file to another PDF file, refer to the following article: Append PDF with Node.js REST API.