pdfcpu

Logo

A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu


Changelog

List Permissions

The PDF specification defines a set of permissions that may be set for encrypted documents. This command prints the current permission set. Have a look at some examples.

Usage

pdfcpu permissions list inFile... [flags]

Common Flags


Arguments

namedescriptionrequired
inFilePDF input fileyes

Permission Bits

valuebinaryhex
none0000 0000 0000x000
print1000 0000 0100x804
all1111 0011 1100xF3C

Examples

pdfcpu does not require any password for listing the permissions of an encrypted document unless the user password is set:

$ pdfcpu encrypt enc.pdf --opw opw
writing enc.pdf ...

$ pdfcpu perm list enc.pdf
permission bits: 000000000000 (x000)
Bit  3: false (print(rev2), print quality(rev>=3))
Bit  4: false (modify other than controlled by bits 6,9,11)
Bit  5: false (extract(rev2), extract other than controlled by bit 10(rev>=3))
Bit  6: false (add or modify annotations)
Bit  9: false (fill in form fields(rev>=3)
Bit 10: false (extract(rev>=3))
Bit 11: false (modify(rev>=3))
Bit 12: false (print high-level(rev>=3))

If both passwords are set, you need to provide either one to list permissions:

$ pdfcpu encrypt enc.pdf --opw opw --upw upw
writing enc.pdf ...

$ pdfcpu perm list enc.pdf
Please provide the correct password

$ pdfcpu perm list enc.pdf --upw upw
permission bits: 000000000000 (x000)
Bit  3: false (print(rev2), print quality(rev>=3))
Bit  4: false (modify other than controlled by bits 6,9,11)
Bit  5: false (extract(rev2), extract other than controlled by bit 10(rev>=3))
Bit  6: false (add or modify annotations)
Bit  9: false (fill in form fields(rev>=3)
Bit 10: false (extract(rev>=3))
Bit 11: false (modify(rev>=3))
Bit 12: false (print high-level(rev>=3))

$ pdfcpu perm list enc.pdf --opw opw
permission bits: 000000000000 (x000)
Bit  3: false (print(rev2), print quality(rev>=3))
Bit  4: false (modify other than controlled by bits 6,9,11)
Bit  5: false (extract(rev2), extract other than controlled by bit 10(rev>=3))
Bit  6: false (add or modify annotations)
Bit  9: false (fill in form fields(rev>=3)
Bit 10: false (extract(rev>=3))
Bit 11: false (modify(rev>=3))
Bit 12: false (print high-level(rev>=3))