Blog

The 15 nastiest PDF edge cases we've seen

Rotated scans, merged table cells, fonts with no text behind them, redactions that redact nothing. Fifteen kinds of PDF that break parsers, what goes wrong and how to catch each.

Jonathan Bree

Most PDF parsers work on the sample files they were tested with and fail on the files users send. The failures fall into a small number of recurring kinds: pages that are rotated or skewed, layouts that confuse reading order, tables that lose their grid, fonts that map to the wrong characters, and files that hide content in places a parser does not look. Below are fifteen kinds that cause the most trouble, what goes wrong with each, and a check that catches it before bad text reaches your index or your model.

The examples are types, not individual files, and each one turns up in ordinary business documents: contracts, invoices, statements, reports and scanned archives. For why the format behaves like this in the first place, see the PDF is the last unsolved file format.

Scans and images

1. Rotated pages

A page scanned sideways or upside down, or a landscape table in a portrait document, reaches OCR at the wrong angle. Some files store the rotation as a page setting; others have the image itself turned. Depending on the parser, the result is an empty page, a page of nonsense characters, or text read correctly but placed in the wrong order. Check: compare OCR confidence before and after trying the four orientations, and flag pages where a rotated version scores far higher.

2. Skewed and warped scans

Pages fed crooked through a scanner, or photographed with a phone, have lines that slope or curve. Small skew lowers OCR accuracy; larger skew breaks line detection so words from adjacent lines merge. Curved pages from bound books are worse, because the distortion varies across the page. Check: measure line angle during preprocessing and deskew before recognition, and track per-page confidence so badly warped pages go to review.

3. Low-resolution and faxed pages

Faxes, copies of copies and pages scanned at low resolution lose the detail that separates similar characters: 0 and O, 1 and l, 5 and S. The result reads plausibly but contains wrong digits, which is the worst kind of error in an invoice or a statement. The entry on DPI for OCR covers the thresholds. Check: record the effective resolution of each page and apply stricter validation to numeric fields from low-resolution pages.

4. Hybrid files with a bad hidden text layer

Many scanners add an invisible OCR layer to make a searchable PDF. The page looks like a scan, but a parser that trusts the existing text layer will happily return whatever that scanner’s OCR produced years ago, errors included. Because a text layer exists, the file never gets routed to fresh OCR. Check: when a page is mostly image, compare a sample of the embedded text with a new OCR pass, and prefer the fresh result when they disagree. The routing problem is covered in scanned vs digital PDFs.

Layout and reading order

5. Mixed column layouts

A one-column abstract above a two-column body, a three-column newsletter with a full-width headline, or a statement with a sidebar of account details all confuse reading order. Text comes out with lines from different columns interleaved, which reads as nonsense to a person and as confident nonsense to a model. Check: look for sentences that end mid-phrase and resume unrelated text, or run layout analysis and confirm that blocks are read top to bottom within each column.

6. Repeated headers, footers and page numbers

Every page carries the company name, a confidentiality notice and “Page 4 of 37”. A naive parser includes them all, so a 40-page contract produces 40 copies of the same notice in the middle of clauses. This pollutes chunking and retrieval: a search for “confidential” matches every chunk. Check: detect lines that repeat in the same position across most pages and strip them, the same idea as boilerplate removal on web pages.

7. Footnotes and margin notes

Footnotes sit at the bottom of the page but belong to a sentence in the middle, and margin notes sit beside the text they annotate. Parsers either append them in the wrong place, which splits sentences, or drop them, which loses definitions and exceptions that matter in legal and financial documents. Check: identify small-font blocks near the page edge and keep them as separate, labelled chunks linked to their page instead of merging them into the body.

Tables

8. Merged cells

A header that spans three columns, or a row label that covers four rows, has no equivalent in the positioned text of a PDF. Parsers assign the merged text to one cell and leave the others empty, so values lose their labels. Table structure recognition models handle common cases; unusual spans still break. Check: count cells per row and flag tables where rows have different lengths or where many cells are empty under a header.

9. Tables that span pages

A long table continues across pages, sometimes repeating its header, sometimes not. Without the header the continuation is a block of unlabelled numbers, and a row split across the page break becomes two half-rows. Check: when a table ends at the bottom of a page and another starts at the top of the next with the same column count, treat them as one table and carry the header forward. The post on tables in PDFs goes deeper.

10. Borderless and whitespace tables

Financial statements and reports often lay out tables with aligned text and no ruled lines. To a parser this looks like several short paragraphs. A cell that wraps onto a second line becomes a new row. Check: look for runs of lines where numbers align vertically, and test totals: if the column of numbers should sum to a stated total, the sum shows quickly whether rows were split or lost. Table extraction is the term to search for tools that handle this.

Fonts and characters

11. Fonts with no Unicode mapping

The page renders perfectly, but copying the text gives symbols or shifted letters. The PDF embeds a subset font without a table mapping glyphs back to characters, so the PDF text layer decodes to garbage. Parsers that trust the text layer return that garbage without complaint. Check: score each page’s text for dictionary words or character frequency, and send pages that look like noise to OCR on the rendered image.

12. Text drawn as outlines

Some design and print workflows convert text to vector shapes, so headings or entire pages contain no characters at all. A parser returns an empty page or skips the heading, and the document’s structure goes with it. Brochures, certificates and signed final versions of documents are common sources. Check: flag pages where the rendered image clearly contains text but the extracted text is empty or very short, and route them to OCR.

13. Ligatures, hyphenation and special characters

Ligatures such as “fi” are stored as single glyphs and come out as an odd character or a missing pair of letters, so “financial” becomes “nancial” in some outputs. Line-end hyphens split words. Non-breaking spaces, soft hyphens and unusual dash characters break exact matching. Each is small; together they hurt keyword search on names and codes. Check: normalise Unicode, expand ligatures and rejoin hyphenated words before indexing, as part of wider data normalization.

Hidden and structural content

14. Redactions that redact nothing

A black rectangle drawn over sensitive text hides it on screen but leaves the text in the file. A parser reads straight through the box and returns the names, account numbers or figures the author meant to remove. Invisible text, such as white text on white or text placed off the page, causes the same kind of surprise. This matters in e-discovery and due diligence, where documents arrive from other parties. Check: compare extracted text with what is visible on the rendered page, and flag text that sits under filled shapes or outside the visible area.

15. Form fields, attachments and damaged files

Fillable forms often keep their values in form fields rather than in the page content, so a parser that reads only the page returns the labels and blank boxes; flattened forms behave differently again, which is a trap for form extraction. PDFs can carry embedded attachments that a parser ignores. Password-protected files fail outright, and files with damaged internal tables open in some viewers but not in parsing libraries. Check: inspect each file for form fields, attachments and encryption before parsing, and record a clear failure reason instead of an empty result.

Catching edge cases in a pipeline

The checks above share a pattern. Keep the rendered page next to the extracted text so the two can be compared. Keep page numbers on every chunk so errors can be traced. Validate outputs against what must be true, especially numbers. Record a reason when a page fails instead of passing on empty text. None of this needs exotic tooling, but it does need someone to own it, which is how teams end up with an accidental parsing product. Many of these failures sit above the character level, which is the argument of OCR is solved, document understanding isn’t.

The best test set is your own worst files. Collect the documents that have broken your pipeline before, mark up what correct output looks like, and run every parser change and every vendor you evaluate against them. Public benchmarks rarely include the specific combination of scans, tables and fonts your users send. The best PDF parser and best PDF extraction API roundups are a starting point for a shortlist.

Where Exabase fits

Exabase Extract handles the routing for you: you submit a PDF, digital or scanned, to one endpoint, and OCR is applied where the file needs it. The result includes the text in chunks with page numbers, document properties such as page count, author and title, a thumbnail and a rendered version of the PDF, which makes the rendered-versus-extracted comparison above straightforward. Invoices, resumes and contracts also return structured fields. If a job fails, the reprocess endpoint retries it from the original file without a new upload, as the extract API reference describes.

Extract will not make every case on this list disappear. Exabase does not publish results for specific edge cases such as rotated pages, merged cells or redaction layers, so run your own worst files through it, as you would any PDF parsing service, and keep your validation rules in place for workflows like contract analysis. The free PDF to JSON and PDF to chunks tools are a quick way to test a file, and the file extraction solution shows how extraction connects to storage and search.

Frequently asked questions

What are the most common PDF edge cases that break parsers?

Rotated and skewed scans, mixed column layouts, merged and multi-page table cells, fonts without a Unicode mapping, and hybrid files with a poor hidden OCR layer cause most failures in business documents.

Why does copied text from my PDF come out as random symbols?

The PDF embeds a font without a mapping from glyphs to characters, so the text layer decodes incorrectly. Running OCR on the rendered page is the usual fix.

Can a PDF redaction be undone by a parser?

Yes, if the redaction is only a shape drawn over the text. The text remains in the file and a parser will extract it. Proper redaction tools remove the underlying text as well as covering it.

How do I detect a scanned page inside a digital PDF?

Check whether the page is mostly a single image and whether its text layer is empty, short or low quality compared with a fresh OCR pass. See scanned vs digital PDFs.

Why do PDF tables lose their headers?

Because a PDF has no table object. Merged header cells and headers that are not repeated on continuation pages are rebuilt from layout, and parsers often attach them to the wrong columns or drop them.

How should I test a PDF parser?

Build a test set from the files that have broken your pipeline before, mark up the correct output, and score field and table accuracy on every parser or version you evaluate.

Why does my search match the same footer text everywhere?

Repeated headers and footers were extracted on every page and included in each chunk. Strip lines that repeat in the same position across pages before chunking and indexing.

Does Exabase handle scanned and rotated PDFs?

Exabase Extract handles scanned PDFs with built-in OCR on the same endpoint as digital ones and returns chunks with page numbers. It does not publish figures for specific cases such as rotation, so test with your own files.

Related pages: The PDF is the last unsolved file format, Scanned vs digital PDFs, Tables in PDFs, OCR is solved, document understanding isn’t, PDF parsing, Scanned PDF, File extraction, Best PDF parser for LLMs, Exabase vs LlamaParse

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.