Pagecraft

inspect-form

List PDF form fields

Say what fields a document asks for, and what they currently hold.

Reads
a PDF — application/pdf
Writes
one file — JSON
Tool page
/pdf-form-fields

Example

Find out what a form asks before writing the answers.

Given

  • application.pdf — a PDF carrying form fields

From code

            import { loadDocument, runOperation } from '@pagecraft/core';

const application = await loadDocument({ bytes, name: 'application.pdf' });

const [output] = await runOperation('inspect-form', [application]);
          

From a shell

            pagecraft inspect-form application.pdf
          

What comes back

One JSON file, containing “fullName”.

This example is run by the test suite. If it stopped being true, the build would fail.

Options

This operation takes no options.