
PDF tooling for Go and the command line.
View the Project on GitHub pdfcpu/pdfcpu
This command changes the password which is also known as the set permissions password or the master password. Have a look at some examples.
pdfcpu changeopw inFile opwOld opwNew [ outFile ] [flags]
| name | description | required |
|---|---|---|
| inFile | PDF input file, use - to read from stdin | yes |
| opwOld | current owner password | yes |
| opwNew | new owner password | yes, must not be empty! |
| outFile | PDF output file, use - to write to stdout | no |
You have to set the owner password when you encrypt a file and you can change it anytime later with changeopw.
Change the owner password:
$ pdfcpu encrypt enc.pdf --opw opw
writing enc.pdf ...
$ pdfcpu changeopw enc.pdf opw opwNew
writing enc.pdf ...
Change the owner password for a streamed PDF and upload the result:
$ aws s3 cp s3://acme-legal/client.pdf - \
| pdfcpu changeopw --upw "$UPW" - "$OLD_OPW" "$NEW_OPW" - \
| aws s3 cp - s3://acme-legal/client-rotated-opw.pdf