cd /news/ai-tools/pdf-invoice-extraction-keep-real-zer… · home › topics › ai-tools › article
[ARTICLE · art-172961] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=· neutral

PDF invoice extraction: keep real zeros and review missing fields

A developer outlined a workflow for handling missing and zero-value fields in PDF invoice extraction, arguing that a missing field, an empty string, and a real zero must stay distinct so downstream payment scheduling never invents data. In a sample layout extraction, the tool returned invoice number INV-711 and amount USD 0.00 with page-1 grounding, while an absent purchase order came back as an empty string with an empty bounding-box array. The developer warned against truthiness checks like `amount || null` that erase legitimate zeros, and recommended routing unverified, unspecified, missed, or conflicting fields to a human review queue before anything is scheduled.

recommendation

Store raw and normalized values plus a review reason per field, and route missing, unspecified, missed, or conflicting values to human review before scheduling any payment.

more in playbook: Verifying model output
by read3 min views2 publishedNov 20, 2026

An invoice has a date and a total, but no due date comes back from your extractor. Adding 30 days to the invoice date would invent a payment term. Before any reminder or payment is scheduled, the workflow needs to know what the invoice actually says.

Save the raw value, the normalized value if you have one, and the reason for review. A missing field, an empty string, and a real zero should stay distinct throughout the workflow.

What you know What to do
Nobody has checked the source Leave the field unverified and send it for a source check.
The source gives no due date Record it as unspecified; leave the payment date unset.
The date is visible but the extractor missed it Ask the reviewer to confirm the value against the source.
The invoice gives two conflicting dates Keep both dates and their locations for review.

In ComPDF Intelligent Document Extraction, request the fields your workflow needs. If you're building a payment review queue, start with the invoice number, amount due, and due date. Request source grounding where supported, and attach the page reference when the response includes one. Without a location, give the reviewer the original PDF to check.

On one synthetic invoice, a layout extraction request returned INV-711 and USD 0.00, both located on page 1. The invoice didn't give a purchase order number; that field returned an empty string and an empty bboxes array. The response structure guide explains the value and grounding fields.

Values and source references from one layout extraction result. An empty field on a different invoice still needs a source check.

Avoid a truthiness check on the normalized amount. Once parsed, 0 is a legitimate number; a JavaScript expression such as amount || null would erase it. The review reasons in the table are decisions made by the application or a reviewer; they don't come back as statuses from the extraction API.

Use fictional data. Put each sample on a separate one-page PDF. For B, first omit the due date from a mocked response so you can reproduce the missed-field case on demand. Run a separate pass against real PDFs to see what your extractor actually returns. | Sample | Source text | Check in your application |

|---|---|---|
| A | Due: 2027-03-15 · Amount due: USD 0.00 | Keep the date and the zero. | 

| B | Due: 2027-03-18 · Amount due: USD 120.00 | If the response omits the date, leave it unverified until someone checks the source. | | C | Amount due: USD 120.00 | After checking the source, record that no due date was specified. |

| D | Due: 2027-03-20 · Payment note: due 2027-03-27 | Preserve both candidates and ask for a decision. | Before letting the workflow schedule anything, open the review queue. For each unresolved item, check whether the reviewer can see why it was flagged and where to look. If they can't tell the difference between a blank, a missed value, and two conflicting dates, keep that item out of automatic scheduling.

── more in #ai-tools 4 stories · sorted by recency
── more on @compdf 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/pdf-invoice-extracti…] indexed:0 read:3min 2026-11-20 · —