pdfcpu

Logo

A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu


Changelog

Unlock form fields

This command makes locked form fields writeable. Either supply a list of form field ids taken from the output of pdfcpu form list or skip field ids in order to unlock the whole form.

Have a look at some examples.

Usage

pdfcpu form unlock inFile [ outFile ] [ fieldID | fieldName ]... [flags]

Common Flags


Arguments

namedescriptionrequired
inFilePDF input file containing formyes
outFilePDF output file for dry runsno
fieldIDform field idno
fieldNameform field nameno

Examples

Unlock the field with name dob1:

$ pdfcpu form list english.pdf

english.pdf
Pg L Field     │ Id | Name       │ Default          │ Value                    │ Options
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1 * Textfield │ 30 | firstName1 │ Joe              │ Jackie                   │
   * Textfield │ 31 | lastName1  │ Doeby            │ Doe                      │
   * Datefield │ 32 | dob1       │ 01.01.2000       │ 31.12.1999               │
   * RadioBGr. │ 33 | gender1    │ male             │ non-binary               │ female,male,non-binary
   * ListBox   │ 34 | city11     │ Vienna,São Paulo │ San Francisco,Vienna     │ San Francisco,São Paulo,Vienna
   * ComboBox  │ 35 | city12     │ San Francisco    │ Sidney                   │ London,San Francisco,Sidney
   * CheckBox  │ 36 | cb11       │                  │ Yes                      │
   * Textfield │ 37 | note1      │                  │ This is a sample text.\n │

$ pdfcpu form unlock english.pdf dob1
writing english.pdf...

$ pdfcpu form list english.pdf

english.pdf
Pg L Field     │ Id | Name       │ Default          │ Value                    │ Options
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1 * Textfield │ 30 | firstName1 │ Joe              │ Jackie                   │
   * Textfield │ 31 | lastName1  │ Doeby            │ Doe                      │
     Datefield │ 32 | dob1       │ 01.01.2000       │ 31.12.1999               │
   * RadioBGr. │ 33 | gender1    │ male             │ non-binary               │ female,male,non-binary
   * ListBox   │ 34 | city11     │ Vienna,São Paulo │ San Francisco,Vienna     │ San Francisco,São Paulo,Vienna
   * ComboBox  │ 35 | city12     │ San Francisco    │ Sidney                   │ London,San Francisco,Sidney
   * CheckBox  │ 36 | cb11       │                  │ Yes                      │
   * Textfield │ 37 | note1      │                  │ This is a sample text.\n │

Unlock the whole form in english.pdf:

$ pdfcpu form unlock english.pdf
writing english.pdf...

$ pdfcpu form list english.pdf

english.pdf
Pg L Field     │ Id | Name       │ Default          │ Value                    │ Options
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1   Textfield │ 30 | firstName1 │ Joe              │ Jackie                   │
     Textfield │ 31 | lastName1  │ Doeby            │ Doe                      │
     Datefield │ 32 | dob1       │ 01.01.2000       │ 31.12.1999               │
     RadioBGr. │ 33 | gender1    │ male             │ non-binary               │ female,male,non-binary
     ListBox   │ 34 | city11     │ Vienna,São Paulo │ San Francisco,Vienna     │ San Francisco,São Paulo,Vienna
     ComboBox  │ 35 | city12     │ San Francisco    │ Sidney                   │ London,San Francisco,Sidney
     CheckBox  │ 37 | cb11       │                  │ Yes                      │
     Textfield │ 38 | note1      │                  │ This is a sample text.\n │