{"slug": "reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then", "title": "Reading PDFs with no extractable text from a glyph table: AI drafts it once, then every run is free and identical", "summary": "A hobbyist developer built an open-source glyph-table method that reads PDFs with no extractable text by mapping each drawn glyph shape to a character once, then looking shapes up on every later run without any AI. Tested on 12 months of synthetic statements and Japan's Statistics Bureau population reports, the approach produced zero silent errors across 5,259 English and 4,207 Japanese characters, while OCR made 126 and 249 errors respectively and four Claude models confidently misread look-alikes such as I versus l and カ versus 力, with only 0 to 2 of 11 pages reading identically across three passes. The code and results are published in the document-extraction-lab repository under topics/glyph-table/.", "body_md": "When I analyze statistics as a hobby, the source numbers are often published only as PDFs from government offices: monthly reports that come out in the same layout every month. With a normal PDF, you can copy the numbers and paste them into a spreadsheet. But some PDFs read fine on screen and give you a string of symbols when you copy, or don't let you select any text at all.\n\nThey look the same, but the inside is different. A normal PDF contains data saying \"the character 'S' is here.\" A PDF with no extractable text only says \"a shape made of these lines is here\"; the PDF itself does not know which character it is.\n\nTo read such a PDF, you usually render the page as an image and run it through OCR, or these days hand it to an AI model. But paying for AI every time you read a monthly report, and getting slightly different results each time, is a poor fit for hobby analysis.\n\nThis kind of PDF has one useful property: **the same character is drawn with exactly the same shape every time**. Unlike handwriting, a \"5\" is always the same \"5\". So if you build a table that says \"this shape is 5\" once, you should be able to read every later issue just by looking shapes up. I call this table the glyph table.\n\nI built this method and compared it with OCR and with AI (four Claude models from Anthropic) under the same conditions. For test data I used samples I made myself and public data anyone may use (the monthly report \"Population Estimates\" from the Statistics Bureau of Japan).\n\nEverything I built and every result is public: [document-extraction-lab](https://github.com/yasumorishima/document-extraction-lab) (`topics/glyph-table/`).\n\nFrom the first month's PDF, collect every glyph shape. Put identical shapes into one group and decide which character each group is; that gives you the glyph table. AI models answer which character each group is, and a person checks only the groups where the models disagree (more on this below).\n\nFrom the second month on, you only look shapes up in the table. No AI is used, so it costs nothing, nothing goes over the internet, and the same PDF always gives the same result.\n\nThe rule I cared about most: **never make up a character it does not know**. A shape that is not close enough to any shape in the table is not forced into a match; it comes out as \"?\". When different characters with similar shapes end up in the same group, that group also comes out as \"?\". A person who looks will notice a \"?\", but nobody notices a plausible wrong character.\n\nFirst I made 12 months of fictional monthly statements myself. The item-code column deliberately mixes look-alikes: capital I, small l and 1; O and 0; and in Japanese, katakana カ (ka) and the kanji 力 (power), the long-vowel mark ー and the kanji 一 (one), and so on. In the English font I used, I and l differ in height by only about 5%.\n\nI made the same statements 17 ways: different fonts, Japanese text, ruled lines, tighter letter spacing, and so on. I built the table from January alone and read February to December.\n\nWhat I counted is the **silent error**: a character read as a different one with no warning. A \"?\" does not count as an error.\n\nThe glyph table had 0 silent errors in both English (5,259 characters) and Japanese (4,207 characters). In 16 of the 17 conditions it stayed at 0 for all 11 months.\n\nOCR made 126 errors in English, reading O as 0 and I or l as 1, among others. In one month the amount \"5,583\" became \"5,983\". In Japanese it made 249 errors, 12 of them in digits, such as reading 0 as 9.\n\nI told the AI models: \"watch out for look-alikes, and you may write ? for a character you are not sure of.\" Even so, all four confidently picked between I and l, or between カ and 力, and got them wrong. Opus 5.5 made 11 to 15 errors in English; in Japanese every model made more than 190. When I had each model read the same page 3 times, only 0 to 2 of 11 pages came out the same all 3 times. The answer changes from read to read.\n\nOn the other hand, with a font where I and l look clearly different, the AI (Opus 5.5) also made 0 errors. What AI struggles with are strings like item codes, where the surrounding text gives no hint of what the character probably is.\n\nThe only errors the glyph table made, 25 characters, were in a condition built so that glyph shapes drift slightly on purpose. But in that condition, building the table already shows that \"the same character does not have a consistent shape\". In other words, **you know the PDF is risky before you read it**.\n\nTesting only on samples I made myself could turn into a test that suits me. So I also tested on a real document: 12 monthly issues of the Statistics Bureau of Japan's \"Population Estimates\". It is packed with small-print tables mixing kanji, Latin letters and digits.\n\nThese PDFs are actually normal PDFs you can copy from. So I made versions with the text information removed, leaving \"only the shapes\", and checked the results against the original text as the answer key. I built the table from the December issue alone and read the January to November issues of the following year, about 150,000 characters.\n\nThe glyph table had 0 silent errors here too. OCR made 4,145 errors, such as reading 人 (person) as \"A\", ＋ as 十 (ten), and 月 (month) as \"4\".\n\nTo be honest, **the top AI models (Opus 5.5 and Fable 5.2) also made 0 errors on this report**. On an ordinary government document without confusing item codes, the glyph table does not win on accuracy.\n\nThe difference is elsewhere:\n\nIn the January to October issues, about 3% of characters came out as \"?\", mostly characters that never appeared in the December issue the table was built from.\n\nIn the November issue this jumped to 77%. Looking into it, the size of the digits in the tables had changed slightly. Those sizes were not in the table, so the glyph table **marked every November digit as \"?\" instead of misreading it**. Once a person checks the new digit sizes and adds them to the table, it reads the following months again.\n\nAs someone who uses the data, I would much rather be told \"I don't know\" than be given a silent error.\n\nI also let AI decide \"which character is this group\" when building the table. Each group's representative glyph is shown inside the line where it was printed, with a red box around it, and the model answers which character it is.\n\nFor the 1,016 groups of the Population Estimates, Fable 5.2 answered 1,000 correctly. That is very good, but using that table without a check still gave 200 silent errors over 11 months. On the self-made statements, a single wrong entry (l answered as I) grew into 210 errors over 11 months. A wrong table repeats the same mistake every month.\n\nChecking everything by hand is a lot of work, though. So I **had four AI models answer independently, and a person looks only at the groups where their answers split**. On the self-made statements, the person had to look at only 5 of 83 groups in English and 7 of 90 in Japanese, and every group where the majority vote was wrong was among them. On the Population Estimates, the person looks at 113 of 1,016 groups (about 1 in 10), and the corrected table had 0 silent errors.\n\nThe key is to **mix different kinds of AI models**. When I had the same model answer 3 times, it repeated the same mistake 3 times, so the answers never split and the mistake went unnoticed.\n\nThere was one place, though, where all four models made the same mistake (i answered as j). That character happened not to appear in later months, so it just didn't affect the results.\n\nWhen a page is rotated, the glyph orientations no longer match the table. When I tried reading pages turned upside down, silent errors appeared: n and u, and 6 and 9, turn into each other's exact shapes when flipped.\n\nSo before reading, the method measures the page's tilt and orientation and straightens it. In addition, pages where more than 30% of characters are \"?\", and pages tilted by more than 10°, are not read at all and go to a person as a whole.\n\nI tested this **after deciding and publishing \"what counts as a pass\" before running anything**, so the criteria could not be changed afterwards to suit the results. Rounds 1 and 2 partly failed; round 3 finally passed everything. On the Population Estimates, all 66 tilted or rotated pages had their orientation and tilt corrected. The records of the failed rounds are kept as they are.\n\nWithin what I tested:\n\nI hope this helps anyone who collects statistics published in the same layout every month.\n\n`q`/` Q`/` cm`) and drops long thin rectangles as ruled lines`-dNoOutputFonts`, and the original text was used as the answer key. These are not PDFs that were made of shapes to begin with. In the November issue the table digits changed from 7.5 pt to 7.14 pt and from 7.92 pt to 7.8 pt\nCreated by processing \"Population Estimates\" (Statistics Bureau of Japan) ([https://www.stat.go.jp/data/jinsui/new.html](https://www.stat.go.jp/data/jinsui/new.html)), under the Public Data License (Version 1.0). Because the PDFs include font rights, the repository does not contain the PDFs; it holds only the download and conversion scripts and the reading results.", "url": "https://wpnews.pro/news/reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then", "canonical_source": "https://dev.to/yasumorishima/reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then-every-run-is-free-33ek", "published_at": "2026-11-23 23:31:09+00:00", "updated_at": "2026-11-23 23:42:35.009885+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "ai-research"], "entities": ["Anthropic", "Claude", "Statistics Bureau of Japan", "document-extraction-lab"], "also_reported_by": [], "takeaway": "For fixed-layout PDFs with no extractable text, build a glyph table from one issue and look shapes up thereafter: it gave 0 silent errors versus 126 for OCR and 11-15 for Opus 5.5 in English, and unlike AI it returns identical output every run.", "recommendation": {"advice": "When extracting characters from fixed-layout PDFs, map glyph shapes to characters once and emit '?' for unmatched or ambiguous shapes rather than letting an LLM guess between look-alikes.", "playbook": "output-verification", "playbook_url": "https://wpnews.pro/playbooks/output-verification"}, "alternates": {"html": "https://wpnews.pro/news/reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then", "markdown": "https://wpnews.pro/news/reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then.md", "text": "https://wpnews.pro/news/reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then.txt", "jsonld": "https://wpnews.pro/news/reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then.jsonld"}}