Welcome folks today in this post we will be talking about how to encrypt pdf files with password in node.js using a library called Hummus Recipe Library. All the source code of the application is given below. A step by step youtube video is also shown below.
In order to get started we need to first of all create a brand new node.js project and execute the following command to install this package
<br />npm i hummus-recipe --save
Now make the
index.js file which will be the starting point of the application and copy paste the following code
const HummusRecipe = require('hummus-recipe');
const pdfDoc = new HummusRecipe('##inputfile##.pdf', '##outputfile##.pdf');
- Encrypt: This method is used to encrypt the pdf files with a password. Here we have used the password 123.