0

I am working jsPDF.js functions and create simple PDF using jsPDF.But i need to set password for downloaded pdf while i need to modify that pdf without password encryption.And I have developed a tool in javascript along with pdf preview download.

Now i need an answer that "how i(admin) want to keep a password to my pdf preview download like an encrypt .because user can`t modify that downloaded PDF

Here i attached sample code for create pdf.

var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');
doc.save('sample.pdf');

How to achieve to set password for downloading pdf section.Kindly advise me.

5
  • 1
    you have to make the file disabled until it makes some call to a backend script with a login, or possibly have a login occur before and then don't allow download unless they are properly logged in. none the less, you will need a server side script to call with a password. Commented Jan 20, 2015 at 4:33
  • @Geohut.I need to view that download pdf but i need to modify in adobe illustrator and so on , it will reply password for modify that downloaded pdf. Is it possible in javascript that jspdf..? Commented Jan 20, 2015 at 4:38
  • 1
    Not JavaScript alone if you include front end only. The password would never be secure. You would have to store the password on the client side. And just have some fake check which isn't really password protecting Commented Jan 20, 2015 at 4:40
  • @Geohut then how to achieve it..bcz i customized entire pdf and create vector format PDF using JSPDF.js using server side.I need to download that PDF with password protected... Commented Jan 20, 2015 at 4:53
  • To answer the question, I would need to know what technologies you are using client side and server side. are you using Angular, Jquery, Extjs, or pure javascript clientside? are you using PHP, Perl, Python, Ruby, or Node server side? Commented Jan 20, 2015 at 4:57

1 Answer 1

0

If you are using node.js then you can use node-qpdf. This is a wrapper around qpdf which supports AES 256, AES 128, RC4 128 & RC4 40 encryption all supported by Adobe Reader.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.