pdfcpu

Logo

A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu


Changelog

Decrypt

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.

Usage

pdfcpu decrypt inFile [ outFile ] [flags]

Flags

namedescriptionrequired
upwuser passwordno
opwowner passwordno

Common Flags


Arguments

namedescriptionrequired
inFileencrypted PDF input fileyes
outFilePDF output fileno

Examples

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 ...