A PDF processor written in Go.
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 [-opw ownerpw] inFile upwOld upwNew
name | description | values |
---|---|---|
v(erbose) | turn on logging | |
vv | verbose logging | |
q(uiet) | quiet mode | |
-o(ffline) | disable http traffic | |
c(onf) | config dir | $path, disable |
opw | owner password | |
upw | user password | |
u(nit) | display unit | po(ints),in(ches),cm,mm |
name | description | required |
---|---|---|
inFile | PDF input file | yes |
upwOld | current user password | yes |
upwNew | new user password | yes |
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 -upw upw enc.pdf
writing enc.pdf ...
$ pdfcpu changeupw enc.pdf upw upwNew
writing enc.pdf ...
Set the user password of a document that has none. Any encrypted PDF file has either one of the two passwords set. Whenever you change the user password of a document that has a owner password set, you have to provide the current owner password:
$ pdfcpu encrypt -opw opw enc.pdf
writing enc.pdf ...
$ pdfcpu changeupw enc.pdf "" upwNew
Please provide the owner password with -opw
$ pdfcpu changeupw -opw opw enc.pdf "" upwNew
writing enc.pdf ...