This tutorial demonstrates how to PDF Node.js developers can decrypt a PDF file using the Aspose PDF Cloud REST API, covering the complete flow from uploading the encrypted document to downloading the decrypted result — all with the official Node.js SDK. For more information about the PDF format, see the PDF file info page.
Prerequisite
- Create an account and obtain API credentials to work with protected PDFs
- Download the Aspose.PDF Cloud SDK for Node.js
- Set up a Node.js project and add the SDK as a dependency
Steps for Removing Password from PDF Document using Node.js Low Code API
- Import necessary classes and modules from the library
- Create the PdfApi object by setting the API secret and ID
- Load the encrypted PDF file into a file stream
- Convert the PDF password to a Base64 string
- Invoke the PutDecryptDocument method by passing the required parameters
- Call the DownloadFile method to retrieve the updated PDF file
The steps above illustrate how to decrypt a PDF document using the Node.js‑based API: instantiate PdfApi, read the source PDF into a memory stream, provide the password (encoded in Base64), call PutDecryptDocument to remove the protection, and finally download the decrypted file from Cloud storage.
Code for Removing Password from PDF Online using Node.js REST Interface
This snippet can be used to decrypt PDF online using the Node.js REST API. When you call PutDecryptDocument(), you specify the output file name that will store the decrypted PDF in Cloud storage; the same name is then used with the DownloadFile method to fetch the result.
To learn how to add password protection to a PDF, refer to the article Add Password Protection to PDF using Node.js REST API.
Keywords: removing password from pdf using Node.js REST API; decrypt pdf using Node.js REST API; decrypt pdf document using Node.js-based API; decrypt pdf online using Node.js REST API.