
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 open doc password. Have a look at some examples.
pdfcpu changeupw inFile upwOld upwNew [ outFile ] [flags]
| name | description | required |
|---|---|---|
| inFile | PDF input file, use - to read from stdin | yes |
| upwOld | current user password | yes |
| upwNew | new user password | yes |
| outFile | PDF output file, use - to write to stdout | no |
You can set the user password either when you encrypt a file or later with changeupw.
Change the user password of a document that already has one:
$ pdfcpu encrypt enc.pdf --upw upw --opw opw
writing enc.pdf ...
$ pdfcpu changeupw enc.pdf upw upwNew
writing enc.pdf ...
Set the user password of a document that has none. Whenever you change the user password of a document you also have to provide the current owner password:
$ pdfcpu encrypt enc.pdf --opw opw
writing enc.pdf ...
$ pdfcpu changeupw enc.pdf "" upwNew
Please provide the owner password with --opw
$ pdfcpu changeupw enc.pdf "" upwNew --opw opw
writing enc.pdf ...
Change the user password for a streamed PDF and upload the result:
$ aws s3 cp s3://acme-legal/client.pdf - \
| pdfcpu changeupw --opw "$OPW" - "$OLD_UPW" "$NEW_UPW" - \
| aws s3 cp - s3://acme-legal/client-rotated-upw.pdf