Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to open the password protected file with pdf.js? #1228

Closed
tamillarasan opened this issue Feb 16, 2012 · 5 comments
Closed

Is it possible to open the password protected file with pdf.js? #1228

tamillarasan opened this issue Feb 16, 2012 · 5 comments

Comments

@tamillarasan
Copy link

Hi

Thanks for this great project.

I want to use pdf.js to open password protected files. I tried opening the password protected file and got the error saying "Incorrect password". I tried providing the password directly in the code by passing it as an argument to PDFDocModel setup(), still receiving the same error. Is there any way to provide password for opening the pdf file?

Or Is this feature currently supported by pdf.js?

@jviereck
Copy link
Contributor

@tamillarasan, I don't think we pass password stuff to the worker. That means, the worker can't open the PDF file :/ Can you hack it for the worker as well and see if that works then?

@vasa1
Copy link

vasa1 commented Apr 8, 2012

I'm using the pdf.js add-on with Firefox 12 (beta) on Ubuntu 11.10.

I can open password-protected files saved to my PC using Evince but not with the pdf.js add-on.
I see "an error occured while reading the PDF".

In "more information", I see "PDF.JS Build: 6833f64
Message: incorrect password
Stack: error("incorrect password")@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:937
prepareKeyData([object Uint8Array],(void 0),[object Uint8Array],[object Uint8Array],-3900,3,128,true)@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:12344
CipherTransformFactory([object Object],".jb\x8E#JU\x815\xDF\xEC\xDF\x99\xEB\xD5w")@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:12380
XRef([object Object],34835,0)@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:2918
pdfDocSetup()@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:614
init([object Object])@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:519
PDFDocModel([object Object])@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:509
PDFDoc([object ArrayBuffer])@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:673
pdfViewLoad([object ArrayBuffer],0)@resource://pdf.js/web/viewer.js:435
getPdfLoad([object ArrayBuffer])@resource://pdf.js/web/viewer.js:282
getPdfOnreadystatechange([object Event])@file:///home/aes/Documents/AXIS/001AXIS_Dec_2011.pdf:76".

I can open simple files which are not password-protected without any problem.

@vasa1
Copy link

vasa1 commented Apr 8, 2012

Please note that I wasn't asked to enter the password even though part of the "more information" cites "Message: incorrect password" near the top.

@mahiuchun
Copy link

Hi, devs.

Can you implement a nice error message first? Like, "PDF with password protection is not supported yet."

@yurydelendik
Copy link
Contributor

shall be resolve by the pull request above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants