How PDF Text Extraction Actually Works
A resume PDF stores positioned glyph runs, not sentences. Extracting text for an ATS means rebuilding words and lines from geometry. Here is how that works.
Every piece of resume formatting advice ultimately rests on a single question: what happens when software reads the text back out of a PDF? The answer is less obvious than it sounds. A PDF does not store sentences, paragraphs or even words. It stores individually positioned glyph runs, each placed at exact coordinates on a page. Reading text back means rebuilding lines and words from geometry, and the rules that govern that reconstruction explain every extraction failure we measured in our study.
The short version
- A PDF stores positioned glyph fragments, not readable text. Lines and words must be reconstructed.
- Fragments within 2.5 points of vertical distance are grouped into the same line.
- A space is inserted between fragments when the horizontal gap exceeds the greater of 1.1 points and 0.22 times the character height.
- A file with no space characters at all scored 99.8% recovery. Word boundaries were rebuilt from geometry alone.
A PDF is not what it looks like
Open a PDF and you see a page of text. Select a paragraph, copy it, paste it, and you get words and sentences. That experience creates a natural assumption: the file contains text the way a Word document or an HTML page does, as a stream of characters with spaces and line breaks.
It does not. A PDF is a page description language. It stores instructions for drawing glyphs at specific coordinates on a fixed-size canvas. A typical instruction says: move to position (72, 648), set the font to Helvetica at 11 points, and draw the string "Senior Backend Engineer". The next instruction might say: move to position (72, 636) and draw "2022 - Present".
There is no paragraph object. There is no line object. There is no explicit word boundary except where a space character happens to be part of a drawn string. The visual layout you see is an emergent property of hundreds of positioning instructions, and extracting readable text means reversing that process.
What a PDF actually stores: positioned glyph runs
The fundamental unit of text in a PDF is the text-showing operator. The most common one, Tj, draws a string of glyphs at the current text position. Its companion, TJ, draws an array of strings with individual kerning adjustments between them. Both produce what we call positioned glyph runs: sequences of characters placed at specific coordinates.
A single line of text might be stored as one run, three runs or thirty runs, depending on how the PDF was created. A tool like pdf-lib that places text programmatically might emit one run per line. A tool like InDesign that kerns and tracks text might emit dozens of short runs with precise positioning between them. A tool that converts from HTML might do something else entirely.
From the reader's perspective, none of this matters at the individual run level. What matters is what happens next: how those runs are assembled back into the lines and words that a human would read.
Stage one: grouping fragments into lines
The first reconstruction step is vertical. The reader collects all positioned fragments on a page and groups them by vertical position. Fragments whose y-coordinates are within a small tolerance of each other are treated as belonging to the same line.
In the extraction rules we ship and tested, that tolerance is 2.5 points. Two fragments at y=648.0 and y=647.8 belong to the same line. Two fragments at y=648.0 and y=644.0 do not. The threshold is small enough that normal line spacing, even tight line spacing, never merges two lines. Our tight-leading condition set spacing at two points and the grouping still separated every line correctly.
But this same rule is why side-by-side layout causes damage. A two-column resume places text from the left column and the right column at the same vertical position. The reader groups them into the same line, because it has no concept of columns. It sees fragments at similar y-coordinates and joins them. The result is welded lines that mix unrelated content.
- Two columns, narrow gutter33.1%
- Two columns30.5%
- Table grid24.1%
- Single column (control)0%
Stage two: deciding where words begin and end
Once fragments are grouped into lines, the reader sorts them left to right within each line and examines the horizontal gaps between consecutive fragments. Each gap must be classified: is this a space between words, or is this the natural gap between glyphs within a single word?
The rule we ship compares the gap to a threshold defined as the greater of 1.1 points and 0.22 times the character height. If the gap exceeds the threshold, a space is inserted. If it does not, the fragments are joined without a space.
This threshold scales with font size, which has important consequences. At 11-point body text, the threshold is about 2.4 points. At 16-point heading text, it is about 3.5 points. Natural glyph advance, the distance the PDF engine leaves between characters when rendering a word, almost always falls under this threshold. The word holds together.
Add letter-spacing and the gap grows. At typical tracking values used in resume templates, the added space pushes every inter-character gap over the threshold, and every character becomes a separate word. This is the mechanism behind the letter-spacing finding in our study.
When there are no space characters at all
One of the most striking results in our study came from the no-space-characters condition. This document contained literally no space characters. Every gap between words was produced by coordinate distance alone: the PDF moved the drawing position to where the next word should start, without ever writing a space character.
It scored 99.8% word recovery and 99.8% reading-order fidelity. The reader reconstructed almost every word boundary from geometry alone. The gaps between words were large enough to cross the threshold, and the gaps within words were small enough to stay under it.
This result is worth understanding because it shows that the word-boundary algorithm is not looking for space characters. It is measuring distances. A file that contains space characters and a file that relies entirely on coordinate gaps are processed by the same rule, and both work. The space character, when present, is just another fragment that happens to be whitespace.
- 01Jordan Rivera
- 02Senior Backend Engineer
- 03jordan.rivera@example.com | 555-0142 | Austin, TX
- 04EXPERIENCE
- 05Senior Backend Engineer, Northwind Systems
- 062022 - Present
- 07- Migrated 47 services from virtual machines to Kubernetes across three regions.
- 08- Cut median checkout latency from 840ms to 210ms by reshaping the pricing query.
| Condition | Words | Order | Welded |
|---|---|---|---|
| Single column (control) | 100% | 100% | 0% |
| No space characters | 99.8% | 99.8% | 0% |
Why letter-spacing breaks words
With the word-boundary rule understood, the letter-spacing failure becomes mechanical. Letter-spacing adds a fixed amount of horizontal space between every pair of characters. When that added space is enough to push the inter-character gap over the threshold, every character becomes a separate word.
The threshold scales with font size, so larger text has a higher absolute threshold. But letter-spacing applied to headings is also proportionally larger, because designers want the effect to be visible at the heading's font size. The result is that headings are consistently the most fragile text.
In our study, both letter-spacing conditions scored 96.9% recovery. The loss was entirely in the headings. Body text extracted perfectly even when drawn glyph by glyph, because without added tracking, natural character advance stays well under the threshold.
Why side-by-side layout welds lines
The line-grouping rule explains the column problem just as mechanically. A two-column resume places a skills label and a job description at the same vertical position on the page. The reader groups all fragments within 2.5 points of vertical distance into one line, sorts them left to right, and emits them as a single string.
The result is a welded line: "SKILLS - Cut median checkout latency from 840ms to 210ms by reshaping the". The words are all present. The sentence was never written. Two-column layout scored 30.5% welded lines, and the narrow-gutter variant scored 33.1%.
The reader is not making an error. It is following a consistent geometric rule that works correctly for any single-column document. The problem is that side-by-side layout violates the assumption the rule depends on: that fragments at the same vertical position belong together.
What this means for your resume
Understanding the extraction pipeline makes the formatting advice concrete rather than arbitrary. Every recommendation maps to a specific stage of the reconstruction process and a specific way it can fail.
Single-column layout works because line grouping can only produce correct results when each vertical position contains fragments from a single logical line. Letter-spacing fails because it pushes inter-character gaps over the word-boundary threshold. Scanned images fail because there are no positioned fragments to process at all.
The pipeline is simple and the rules are public. The line-grouping tolerance is 2.5 points. The word-boundary threshold is the greater of 1.1 points and 0.22 times the character height. These are not secret algorithms. They are geometry, and geometry can be checked. Our study tested them across 108 documents and the results were consistent.
- Keep the body in one column. Line grouping cannot distinguish columns from a single wide line.
- Do not letter-space section headings. The added tracking pushes every character gap over the word-boundary threshold.
- A text layer is required. Without one, there are no positioned fragments and nothing to extract.
- The extraction rules are geometric, not semantic. The reader does not know what a resume is. It measures positions.
One reader was tested: PDF.js, the same library the X-ray runs. Employer systems use other extractors and may differ. Findings describe how these formatting choices behave under extraction, not how any particular company screens.
Sources and further reading
- PDF.js — Mozilla
- pdf-lib — pdf-lib
- PDF 32000-1:2008, Document Management — Portable Document Format — Adobe / ISO
- The Unicode Standard — Unicode Consortium
See what your resume gives back.
Drop your PDF in and ATSPrep reads it back with a real text extractor, so you see what a parser recovers from it. No account, no upload, and no opaque compatibility score.
Scan my resume