PDFCraft
Extraction guide

Extract a expense report PDF to JSON

Everything below is the response the live API returned for a expense report, generated when this page was built. Not a description of what it would return — the output itself, including what it scored low on.

Who this is for

Expense and spend-management tools taking a signed PDF from a finance team that will not change its process.

The job, in the words people search for: “read submitted expense reports into an approval system”.

What makes this shape awkward

Two currencies in one table — the amount as spent and the amount converted — plus an exchange-rate column of four-decimal numbers. Three numeric columns of very different magnitude sit side by side, which is exactly where right-aligned column bands overlap.

The measured result

Pages read1
Time9 ms (9 ms/page)
Labelled fields found unprompted5
Tables1 (11 rows)
Inputexpense-report.pdf (30 KB — synthetic, generated from a spec in the repo; real documents of this type cannot be published)

Fields, with a schema

Ask for the fields you want by the label printed on the page. Each answer carries the text exactly as printed (raw), the value coerced to the type you asked for, a confidence, and a bounding box you can draw on the page to check it.

curl -X POST https://api.pdfcraft.dev/v1/extract \
  -H "Authorization: Bearer $PDFCRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file": "<base64 of your expense report>",
    "schema": {
      "report_number": "string",
      "submitted": "date",
      "total_claimed": "currency"
    }
  }'

What came back

Fieldrawvalueconfidence
report_numberEXP-2026-1188"EXP-2026-1188"60%
submitted2026-04-01"2026-04-01"70%
total_claimedGBP 2,418.902418.9 GBP70%

Every label it found without being asked

Send no schema and you get all of these, keyed by the label as printed. Useful for discovering what a new supplier’s layout actually contains before you write a schema against it.

Report Number, Employee, Period, Submitted, Total Claimed

Tables

Date · Category · Spent · Currency · Rate · Claimed (GBP) · 11 rows × 6 columns · page 1

Table confidence 90%. Header confidence 100% — the first row was promoted out of the data.

DateCategorySpentCurrencyRateClaimed (GBP)
2026-03-01Flights213.00EUR0.9822209.21
2026-03-03Hotel325.00USD1.1490373.43
2026-03-05Taxi23.00EUR0.924521.26

First 3 of 11 rows.

With options.rows_as_objects, the same row keyed by its header:

{
  "Date": "2026-03-01",
  "Category": "Flights",
  "Spent": "213.00",
  "Currency": "EUR",
  "Rate": "0.9822",
  "Claimed (GBP)": "209.21"
}

What this does not do

Try it on your own expense report

The playground takes a file and shows the same JSON, with every bounding box drawn over the page. No key and no signup for the first few; a free key gives you 100 pages a month.

Related