Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 592  / 2 Years ago, fri, april 8, 2022, 3:40:15

I have an encrypted pdf, and I am aware of the password, and I would like to use the Ghostscript to make them unencrypted, so they don't require any password to be opened.


I tried using the following, But it seems I'm doing something wrong


gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -c .setpdfwrite -f -sUserPassword=mypassword encrypted.pdf

More From » password

 Answers
6

If you have a pdf that is encrypted and you know the password you can decrypt the pdf as follows


gs -dNOPAUSE -dBATCH -q -sDEVICE=pdfwrite -sPDFPassword=password -sOutputFile=output2.pdf -f input.pdf

Now let me tell you about each option being used



  1. -sDEVICE: its a device, use man gs to learn more

  2. -dNOPAUSE: Disables the prompt and pause at the end of each page. This may be desirable for applications where another program is driving Ghostscript.

  3. -q: do things quietly, no logs on screen

  4. -sPDFPassword: Its the password

  5. -dBATCH: I think it is for quitting the gs


Like every Linux Program, the Documentation (man pages) is written very poorly and doesn't have a lot of information.


[#129] Saturday, April 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
itchlos

Total Points: 486
Total Questions: 115
Total Answers: 110

Location: Macau
Member since Fri, Apr 28, 2023
1 Year ago
itchlos questions
;