CLICommands
inspectLast updated on
Last updated on
Inspect PDF form fields
Inspects PDF form fields to aid in bindings configuration.
Usage
ofm inspect <pdf> [options]Arguments
| Argument | Description |
|---|---|
pdf | PDF template file (path or - for stdin) |
Options
| Option | Description |
|---|---|
--format <format> | Output format: table or json (default: table) |
--filter <pattern> | Filter field names by glob pattern (e.g., party_*) |
--summary | Show totals only (no field listing) |
--include-buttons | Include button fields in the output |
--include-signatures | Include signature fields in the output |
--out <file> | Write inspection result to JSON file |
Description
The inspect command extracts and displays all AcroForm fields from a PDF file. This helps you understand the PDF's field structure when configuring form bindings.
Examples
Inspect a PDF:
ofm inspect form-template.pdfFilter fields by pattern:
ofm inspect form-template.pdf --filter "address_*"Output as JSON:
ofm inspect form-template.pdf --format jsonGet summary only:
ofm inspect form-template.pdf --summarySave to file:
ofm inspect form-template.pdf --out fields.jsonOutput
Table format:
Fields from form-template.pdf:
┌──────────────────┬──────────┬──────────┬─────────┐
│ Name │ Type │ Required │ Value │
├──────────────────┼──────────┼──────────┼─────────┤
│ full_name │ text │ yes │ │
│ address_line1 │ text │ yes │ │
│ address_city │ text │ yes │ │
│ agree_terms │ checkbox │ no │ false │
└──────────────────┴──────────┴──────────┴─────────┘Summary format:
{
"source": "form-template.pdf",
"total": 15,
"breakdown": {
"text": 10,
"checkbox": 3,
"dropdown": 2
}
}