# How to extract structured data from a PDF and review every field

> A careful workflow for turning PDF passages into named fields, checking each value against the source, and exporting reviewed JSON.

Canonical: https://swirlai.app/blog/how-to-extract-structured-data-from-a-pdf
Last updated: 2026-11-07

To extract structured data from a PDF, define the fields before you read, capture the exact passage behind each value, and mark every field accepted, rejected, corrected, missing, or uncertain before export. Keep the source revision with the result: if the PDF changes, review the new revision instead of treating old values as current.

Structured extraction is not the same job as summarising. A summary can be useful while still skipping the invoice number, confusing an issue date with a due date, or flattening two table columns into one. Extraction needs a small contract: named fields, supporting evidence, and a decision on every value.

## Write the field list first

Start with the decision the data will support. Then list only the fields needed for that decision, with a type and a plain description. For an invoice, that might be supplier name, invoice number, issue date, due date, currency, subtotal, tax, total, and purchase-order reference. Do not add a field because it might be useful someday; every extra field creates another value someone must verify.

- Name fields by meaning, not by where they happened to appear on one template.
- Keep dates, money, identifiers, and free text as different types.
- Say which fields are required and what missing means.
- For repeated rows, define the item fields before collecting the list.

## Keep evidence beside the value

Exact PDF selections can become named, typed, revision-bound fields. A person accepts, corrects, marks unsure, or rejects each one, and only accepted fields export as CSV or JSON. This is a bounded review workflow, not a promise of automatic extraction for every document structure.

For a current owned PDF with a text layer, select the exact words that support one field. The evidence should keep the source, source revision, page, exact text, and real page region when the viewer can resolve it. If reliable geometry is unavailable, keep the text evidence and say the visual location is unavailable. A neat-looking box that was guessed from character offsets is worse than no box.

## Review states are part of the data

Do not squeeze every result into value or blank. Keep the source value, a human correction, and the review decision separate. Accept a value only after checking the passage. Reject a wrong match. Mark a required field missing when the document does not supply it, and uncertain when the text is ambiguous or unreadable. A correction should never erase what the source originally said.

## Treat a new PDF as a new review

A replacement file can change a date, amount, or page layout while keeping the same filename. Bind the review to the source revision, not the label in the library. When the source changes, keep the earlier result as historical evidence but make it read-only. Re-run and review the fields against the new revision instead of silently carrying approval forward.

## Export only what was reviewed

Before exporting JSON, check that every required field has an explicit state and that corrected values still retain their source text. The export should describe reviewed data, not imply that the whole document was read perfectly. Keep the original PDF unchanged so another person can reproduce the check later.

## When a specialist PDF tool is the better choice

Use a specialist tool when the real job is OCR for scans, translating a whole PDF, converting PDF to Word or PowerPoint, or automatically scanning many invoices. Monica publicly offers those broader utilities. Swirl's current workflow is narrower: a person selects exact text-layer evidence, gives each field a type (text, date, amount, or number), reviews it, and exports the accepted fields as reviewed JSON or CSV. A correction is stored beside the source text instead of replacing it, and a field marked unsure keeps the review open. It does not promise automatic invoice capture, OCR, format-preserving translation, or converter parity.

## A seven-step review

- Remove data you do not need or have permission to process.
- Write the smallest useful field list and mark required fields.
- Open the current PDF revision and select exact supporting text.
- Create one named field from each relevant selection.
- Accept, reject, correct, mark missing, or mark uncertain field by field.
- Resolve every required field before export.
- Export reviewed JSON or CSV and keep the unchanged source with its revision.

### Try the bounded workflow and compare the broader tools
- [Open PDFs in Swirl](https://swirlai.app/apps/pdfs)
- [Monica ChatPDF](https://monica.im/en/webapp/doc-chat) (Broader document chat, summary, translation, and mind-map workflow.)
- [Monica PDF OCR](https://monica.im/en/pdf-tools/ocr-pdf) (Use when OCR output is the job; Swirl does not claim this utility.)
- [Monica invoice scanner](https://monica.im/en/pdf-tools/invoice-scanner) (Use when automated invoice scanning is the job.)

## Do this in Swirl

Turn exact PDF passages into named fields, then decide what is trustworthy before anything leaves the viewer.

**Monica:** Monica wins on OCR, full-document translation, PDF conversion, and automatic invoice utilities. Swirl's narrower workflow ties exact text-layer selections to a source revision and makes a person accept, correct, or reject each field before reviewed JSON or CSV export; it does not claim batch capture or converter parity.

[Read the fair comparison](https://swirlai.app/vs/chatgpt)

Prompt: Help me define the smallest useful field list for this PDF. For each field, require exact supporting text, keep the source value separate from any correction, and do not export it until I accept or reject it.

[Try this in Swirl](https://swirlai.app/?for=writing&utm_source=blog&utm_medium=how-to-extract-structured-data-from-a-pdf)

### Is structured extraction the same as a PDF summary?

No. A summary explains the document. Structured extraction maps specific evidence to predefined fields and records whether each value was accepted, rejected, corrected, missing, or uncertain.

### Can Swirl automatically scan a folder of invoices?

No. The current Swirl workflow is a bounded, person-reviewed extraction from exact selections in an owned text-layer PDF. It is not batch invoice capture or unattended OCR.

### What happens when the PDF is replaced?

The earlier review remains historical and read-only. The replacement has a new source revision and needs a new field review; prior approval is not silently carried forward.

### Does exporting JSON or CSV change the PDF?

No. The export is a reviewed derivative. The uploaded PDF remains unchanged, and the evidence stays tied to the revision that was reviewed. The CSV keeps the source value beside any correction, and cells that start like a spreadsheet formula are made safe.

## Related

- [How to summarise a PDF without losing the point](https://swirlai.app/blog/how-to-summarise-a-pdf)
- [How to research with AI without losing the sources](https://swirlai.app/blog/how-to-research-with-ai-and-check-sources)
- [How to explain a letter in plain English](https://swirlai.app/blog/how-to-explain-a-letter)
- [Ten jobs you can hand to an AI in a document](https://swirlai.app/blog/ten-jobs-you-can-hand-to-an-ai-in-a-document)
