Change User Password

This command changes the password which is also known as the open doc password. Have a look at some examples.

Usage

  1. usage: pdfcpu changeupw [-v(erbose)|vv] [-opw ownerpw] inFile upwOld upwNew

Flags

namedescriptionrequired
verboseturn on loggingno
vvverbose loggingno
opwowner passwordif set

Arguments

namedescriptionrequired
inFilePDF input fileyes
upwOldcurrent user passwordyes
upwNewnew user passwordyes

Examples

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:

  1. pdfcpu encrypt -upw upw enc.pdf
  2. writing enc.pdf ...
  3. pdfcpu changeupw enc.pdf upw upwNew
  4. 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:

  1. pdfcpu encrypt -opw opw enc.pdf
  2. writing enc.pdf ...
  3. pdfcpu changeupw enc.pdf "" upwNew
  4. Please provide the owner password with -opw
  5. pdfcpu changeupw -opw opw enc.pdf "" upwNew
  6. writing enc.pdf ...