Playbook: turn a PDF or scan into a checkable table
Distinguish text from image input, retain page and row evidence, and check blanks, leading zeros and amounts. Includes designed references, not OCR results.
Downloads and scope
These are fictional orders created for this site under CC BY 4.0. Both PDFs have the same visual content; one has text and the other contains a raster image. The reference table is a designed answer, not OCR output or a tool accuracy claim. The input is in English so characters and columns are easy to compare.
Try the input before opening the reference. For real documents, establish rights, sensitive fields, upload destination and retention rules first. Use the fictional input while those are unresolved.
Define the deliverable
Deliver a UTF-8 CSV plus an exception log. Columns: item_id, description, quantity, unit_price, currency, line_amount, page, source_row, status. Treat IDs as text, retain two decimal places, and leave missing prices/amounts blank with an explicit status instead of zero. page is the original PDF page; source_row is its data-row index, not a CSV file line.
Use only source information. Tax, shipping and the payable total are absent. The sum of known line amounts is not a payable total.
Process page by page
- Try selecting and copying a sentence, then compare it with the page. Copyable text does not prove correct reading order or table structure; check for a hidden OCR layer.
- Extract text/tables from a usable text layer first; use OCR for image-only input. Preserve originals and page images.
- Inspect rotation, cropping and blur before changing image angle or resolution. Check processed images against originals. Tesseract documents table-recognition limitations; recognizing characters does not establish column structure.
- Trial this page: the wrapped description for 001 is one item, and the missing price for 003 stays blank. Check individual cells before scaling up.
- Export the table and exceptions with page/row evidence and a change log. For real multi-page input, also check repeated headers, split rows, footnotes and merged cells.
Reusable task instruction
Convert the supplied order page to CSV without external lookup.
Fields: item_id,description,quantity,unit_price,currency,line_amount,page,source_row,status.
Keep leading zeros in text IDs; join a wrapped description within one item.
Leave missing values blank and give a status. Do not guess prices, tax or totals.
List unresolved cells with their source-page locations. Return one page for review first.
If the tool cannot retain locations, maintain a separate row-by-row evidence record. Do not call the result traceable without one.
Acceptance and reference
- Exactly three data rows, with IDs 001, 002 and 003 unchanged.
- The description for 001 contains Notebook, dotted; it is not two products. Quote the comma correctly in CSV.
- 2 × 12.50 = 25.00; 3 × 4.00 = 12.00; known amounts total CNY 37.00.
- Row 003 has blank unit_price and line_amount, with unit_price_missing status.
- Each row maps to its original data row on page 1. Note that tax and shipping are absent.
Reopen the export with a CSV parser to check column counts and string values. In spreadsheet import, set the ID column to text. Equivalent column names are acceptable; losing evidence or unknowns is not.
When it fails
- No selectable text: establish whether the page is image-only, then choose OCR. For damaged or restricted files, use file troubleshooting.
- Broken names or shifted columns: establish the source grid before fixing extraction rules; do not fill unseen cells.
- Wrong totals: distinguish recognition, arithmetic and source inconsistencies; keep exceptions visible.
- CSV parse failures: check delimiter, quoting, encoding and newlines; see structured-output troubleshooting.
Next step and verification scope
Continue with the multi-table merge exercise. For evidence checks, read verifying AI output.
The cited documentation scope was checked on 2026-11-04. This site generated and checked the text/image PDF fixtures and reference files; it did not run OCR or measure a product.
Sources
| Source | URL |
|---|---|
| Tesseract: image quality and table recognition limits | https://tesseract-ocr.github.io/tessdoc/ImproveQuality.html |
| Python: CSV formatting and string reading | https://docs.python.org/3/library/csv.html |
Source snapshot: 2026-11-04; item-specific rechecks and their scope are recorded in the text or source notes. Features and terms may change; check the original sources before use.
This page appears in: Office documents with AI