1

So far i am generating a Password protected file in node by using HummusRecipe.This has been easily done with HummusRecipe.Following is the code to Encrypt the password protect any pdf file.

                const localFilePath = files.clientDoc.path;
                const outputFilePath = `${process.cwd()}/logs/temp.pdf`;
                const pdfDoc = new HummusRecipe(localFilePath, outputFilePath);
                pdfDoc
                    .encrypt({
                        userPassword: '123',
                        ownerPassword: '123',
                        userProtectionFlag: 4
                    }).endPDF();

Now I want to decrypt the password protected pdf in another api in express.But as far i have researched there is not any decrypt method in HummusRecipe to remove the password protection in the server side.

Another option is qpdf but it's not working in Express and giving 'SPAWN' Error.

Puneet Sharma
  • 246
  • 3
  • 14

1 Answers1

1

You can use PDF.JS in angular.

Maahi Bhat
  • 191
  • 12