Skip to content
This repository has been archived by the owner on Aug 7, 2022. It is now read-only.

How to save/open password encrypted pdf files? #197

Closed
modulitos opened this issue Apr 1, 2016 · 3 comments
Closed

How to save/open password encrypted pdf files? #197

modulitos opened this issue Apr 1, 2016 · 3 comments

Comments

@modulitos
Copy link

First, I want to say thanks so much for this package! It has really improved my experience when viewing pdf files.

There doesn't seem to be any support for password-protected files. It seems that Gmail has support for this as well as the Adobe's tools, so I don't think the protocol is proprietary. Although I wouldn't be surprised if it was :-P

When trying to open such a file, we get the following messages:

File mode specification error: (error "epdfinfo: Error opening /home/me/Downloads/my-password-protected-file.pdf:Document is encrypted")
pdf-info-query: epdfinfo: Error opening /home/me/Downloads/my-password-protected-file.pdf:Document is encryptedError during redisplay: (eval (number-to-string (pdf-view-current-page))) signaled (wrong-type-argument numberp nil)
Error during redisplay: (eval (number-to-string (pdf-cache-number-of-pages))) signaled (error "epdfinfo: Error opening /home/me/Downloads/my-password-protected-file.pdf:Document is encrypted")

I think this feature would be very nice to have, especially when someone sends you a password-protected file. I'm not exactly sure how to implement it though - any tips to get started would be great!

@modulitos
Copy link
Author

It looks like there are numerous commandline tools that can do this here: http://www.cyberciti.biz/faq/removing-password-from-pdf-on-linux/

I'm not sure what dependencies we can expect to be installed, but if one of these is already bundled with this package, then we can just prompt the user to enter their password and trigger the appropriate command from there. Or perhaps there is a Lisp package that can be used for the encryption/decription instead...

@politza
Copy link
Owner

politza commented Apr 2, 2016

If you look at the function pdf-info-open, you'll see, that it already
has a password argument. Though I've never tested it.

The error you mentioned could be caught and, if appropriate, the user be
queried for a password.

@politza
Copy link
Owner

politza commented Aug 9, 2017

Should work now.

@politza politza closed this as completed Aug 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants