Closed mahmoudfelfel closed 11 years ago
There shouldn't be any difference between default url and the ready code... maybe it was cached when you tested or something like that?
Please provide the URL to the example and comment what was changed in standard viewer. PDFView.open() is called on "document ready" by default (https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L3561) not sure why you are using jQuery?
I might not understand your question correctly, but why password-protect your PDF files if you're going to give away the password in the JavaScript source code? You might as well remove the password protection then...
Is there a PASSWORD variable , to decrypt encrypted PDFs ?
No. But you can add one at the viewer.js top and use it at https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L3608
Closing as answered
Hi, please i want to know how to set an encrypted PDF password directly , something like that : DEFAULT_URL : ' the encrypted pdf url ' , PASSWORD : ' the password '
currently i am using this :
$(document).ready(function(){ PDFView.open('the encrypted pdf url ','scale', 'the password'); });
and it doesn't work except it wrapped by document ready , and the problem is that the pdf takes a long time still the whole document loaded and then started loading and rendering the pdf ,but when i am using the DEFAULT_URL it loaded faster . thanks,