
PDF tooling for Go and the command line.
View the Project on GitHub pdfcpu/pdfcpu
This command decrypts inFile and removes password protection. If provided the decrypted PDF will be written to outFile and ìnFile remains untouched. Have a look at some examples.
pdfcpu decrypt inFile [ outFile ] [flags]
| name | description | required |
|---|---|---|
| upw | user password | no |
| opw | owner password | no |
| name | description | required |
|---|---|---|
| inFile | PDF input file, use - to read from stdin | yes |
| outFile | PDF output file, use - to write to stdout | no |
Decrypt a file that has only the owner password set. This will also reset all permissions, providing full access. You don’t need to provide any password:
$ pdfcpu encrypt test.pdf --opw opw
writing test.pdf ...
$ pdfcpu decrypt test.pdf
writing test.pdf ...
Decrypt a file that is protected by both the user password and the owner password. This also removes the open doc password and resets all permissions providing full access. You will need to provide either of the two passwords:
$ pdfcpu encrypt test.pdf --opw opw --upw upw
writing test.pdf ...
$ pdfcpu decrypt test.pdf
Please provide the correct password
$ pdfcpu decrypt test.pdf --upw upw
writing test.pdf ...
Decrypt a streamed PDF and upload the result:
$ aws s3 cp s3://acme-hr/secure/onboarding.pdf - \
| pdfcpu decrypt --upw "$UPW" - - \
| aws s3 cp - s3://acme-hr/plain/onboarding.pdf