{
  "source_file": "0930",
  "source_platform": "Dev.to",
  "author": "Tae Kim",
  "title_listed": "I built a PDF table checker that verifies arithmetic in any PDF without a template",
  "keywords": "",
  "domain": "机器学习",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://dev.to/hannune/i-built-a-pdf-table-checker-that-verifies-arithmetic-in-any-pdf-without-a-template-3aci",
  "publish_date": "2026-07-27",
  "corpus_stage": "",
  "notes": "",
  "id": "ae4403b939f3",
  "collected_at": "2026-10-02T14:04:00",
  "title": "I built a PDF table checker that verifies arithmetic in any PDF without a template - DEV Community",
  "body_markdown": "The problem I kept running into: a financial report where a subtotal on page 8 is wrong, but nobody spots it until the numbers get aggregated into a spreadsheet and something doesn't reconcile.\nI wanted a tool that could ingest any PDF with tables and tell me which totals don't add up. The constraint: no template, no column mapping UI, no server. Every byte in the browser.\nWhat it does\nUpload a PDF. The tool:\nExtracts all text items with their x/y coordinates from each page via pdfjs-dist\nClusters items by y-position into rows (within a 4px snap tolerance)\nDetects which rows are \"total\" or \"subtotal\" rows by keyword matching\nFor each total row, identifies numeric columns and sums the data rows above it (back to the previous header or total)\nCompares computed sum to stated total — flags differences above a 0.1% tolerance\nThe hard part: coordinate-based table detection\nPDF text items don't know they're in a table. The structure is: a stream of (string, x, y, width) tuples. I have to infer table structure purely from spatial relationships.\nThe approach:\nSnap y-coordinates to a 4px grid to handle sub-pixel jitter between lines\nCluster x-positions of numeric cells to find \"column anchors\" — positions that consistently have numbers\nA column anchor that appears in 2+ data rows becomes a verifiable column\nFor each total row, look up the value at each column anchor and compare to the sum above\nThis breaks on rotated text, multi-column layouts, and cells that span multiple columns. But it catches the common case — section subtotals in financial reports, grand totals in expense sheets.\nStack\nNext.js 14, static export on Cloudflare Workers\npdfjs-dist for text extraction (CDN worker, no bundling)\nAll detection and arithmetic runs in the browser\nFreemium\n3 PDFs/month tracked in localStorage. Paid plan unlocks unlimited and CSV export ($9/month).\nLive at:\nhttps://compare-lab.xyz/pdf-table-checker/\nIf you work with tabular PDFs regularly and there's a document structure this approach would miss, I'd like to know.",
  "metadata": {
    "title": "I built a PDF table checker that verifies arithmetic in any PDF without a template - DEV Community",
    "description": "The problem I kept running into: a financial report where a subtotal on page 8 is wrong, but nobody... Tagged with javascript, pdf, webdev, finance.",
    "keywords": "javascript, pdf, webdev, finance, software, coding, development, engineering, inclusive, community",
    "author": null,
    "og:type": "article",
    "og:url": "https://dev.to/hannune/i-built-a-pdf-table-checker-that-verifies-arithmetic-in-any-pdf-without-a-template-3aci",
    "og:title": "I built a PDF table checker that verifies arithmetic in any PDF without a template",
    "og:description": "The problem I kept running into: a financial report where a subtotal on page 8 is wrong, but nobody...",
    "og:site_name": "DEV Community",
    "og:image": "https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1460925895917-afdab827c52f%3Fw%3D1200%26h%3D630%26fit%3Dcrop",
    "twitter:site": "@thepracticaldev",
    "twitter:creator": "@HannuneTech",
    "twitter:title": "I built a PDF table checker that verifies arithmetic in any PDF without a template",
    "twitter:description": "The problem I kept running into: a financial report where a subtotal on page 8 is wrong, but nobody...",
    "twitter:card": "summary_large_image",
    "twitter:widgets:new-embed-design": "on",
    "twitter:image:src": "https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1460925895917-afdab827c52f%3Fw%3D1200%26h%3D630%26fit%3Dcrop"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [],
  "images": [],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://compare-lab.xyz/pdf-table-checker/",
      "label": "https://compare-lab.xyz/pdf-table-checker/",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:49:40Z",
  "source_url": "https://dev.to/hannune/i-built-a-pdf-table-checker-that-verifies-arithmetic-in-any-pdf-without-a-template-3aci",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 2032,
  "expected_body_images": 0,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/ae4403b939f3/pages/source.html",
  "local_html": "attachments/ae4403b939f3/pages/article.html",
  "body_base_path": "attachments/ae4403b939f3/pages/",
  "body_markdown_path": "attachments/ae4403b939f3/pages/article.md"
}