PDFCraft
Extraction guide

Extract a timesheet PDF to JSON

Everything below is the response the live API returned for a timesheet, 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

Staffing agencies and contractor-payment platforms where the signed artefact is a PDF.

The job, in the words people search for: “read approved timesheets into payroll”.

What makes this shape awkward

Hours are decimals in a narrow column and days of the week are the row labels. The totals row at the bottom is not a data row and not a header either, which is a shape most table extractors have no answer for.

The measured result

Pages read1
Time9 ms (9 ms/page)
Labelled fields found unprompted4
Tables1 (7 rows)
Inputtimesheet.pdf (28 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 timesheet>",
    "schema": {
      "contractor": "string",
      "week_ending": "date"
    }
  }'

What came back

Fieldrawvalueconfidence
contractorI. Duarte"I. Duarte"60%
week_ending2026-03-22"2026-03-22"70%

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.

Contractor, Assignment, Week Ending, Approved By

Tables

Day · Start · End · Break · Hours · 7 rows × 5 columns · page 1

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

DayStartEndBreakHours
Monday08:0016:300.58.00
Tuesday08:0017:000.58.50
Wednesday08:0016:000.57.50

First 3 of 7 rows.

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

{
  "Day": "Monday",
  "Start": "08:00",
  "End": "16:30",
  "Break": "0.5",
  "Hours": "8.00"
}

What this does not do

Try it on your own timesheet

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