Skip to content
New issue

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

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

Already on GitHub? # to your account

Show encryption info #30

Closed
azymnis opened this issue Apr 13, 2023 · 4 comments · Fixed by #31
Closed

Show encryption info #30

azymnis opened this issue Apr 13, 2023 · 4 comments · Fixed by #31

Comments

@azymnis
Copy link

azymnis commented Apr 13, 2023

Hello! Thanks for this library.

qpdf allows us to do this:

$ qpdf --show-encryption file.pdf
V = 5
R = 6
P = -4
Has user password: no
Has owner password: yes
User password = 
extract for accessibility: allowed
extract for any purpose: allowed
print low resolution: allowed
print high resolution: allowed
modify document assembly: allowed
modify forms: allowed
modify annotations: allowed
modify other: allowed
modify anything: allowed
stream encryption method: AESv3
string encryption method: AESv3
file encryption method: AESv3

It would be great to wrap this with node-qpdf2 as well

@Sparticuz
Copy link
Owner

Sure, I've got a prototype built. What are you looking for in this info, just the string output, or do you think it's important to have the string parsed? Might be a little difficult because there are two different ways to split the data in the results, both = and : are used.

@azymnis
Copy link
Author

azymnis commented Apr 13, 2023

@Sparticuz thank you! I was mostly interested in finding out whether a pdf is encrypted or not. The rest of the information is not as important. I am building an app where the interaction will look like this:

  1. A user uploads a file
  2. If the file is an encrypted pdf we tell that to the user
  3. The user can click on a prompt and enter the file's password
  4. Our app uses that to decrypt the pdf and store the decrypted version

Thanks again for your help

@Sparticuz
Copy link
Owner

I merged the PR, but i most likely won't be able to cut a new release until tomorrow.

@azymnis
Copy link
Author

azymnis commented Apr 13, 2023

@Sparticuz thank you and that is completely fine

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants