PDF reading-order problems: detect columns, sidebars, and interrupted text
A PDF can look perfectly ordered while its extracted text jumps between columns, repeats headers, or inserts a sidebar mid-sentence. Visual position and logical reading order are different structures and must be checked separately.
Short answer: Read the Markdown without looking at the page first. If sentences break, headings appear late, or columns interleave, compare the PDF tag order and visual layout. Fix the sequence before chunking, summarizing, or feeding the text into RAG.
Why visual order is not enough
Tagged PDF can encode intended reading order and semantic roles such as headings, lists, tables, and figures. W3C guidance notes that PDF reading order is primarily determined by tag order, while content inside a tag follows the content-tree structure. Untagged files and scans may leave extraction software to infer order from drawing commands or pixels.
| Page pattern | Typical extraction failure | Fast check |
|---|---|---|
| Two or three columns | Lines alternate between columns | Read the first two paragraphs aloud |
| Running header/footer | Repeated text interrupts the body | Search for the same short line |
| Sidebar or pull quote | Insert appears mid-sentence | Compare nearby page regions |
| Footnotes | Notes move into the body or disappear | Match every marker to its note |
A practical reading-order audit
- Hide the PDF and read the extracted first page as continuous prose.
- Check one dense middle page with columns, tables, captions, or sidebars.
- Search repeated headers and footers, then decide whether they are content or artifacts.
- Confirm every heading is followed by the section it introduces.
- Verify footnote markers, captions, and continued tables before changing the sequence.
- After corrections, regenerate RAG chunks and source offsets instead of reusing stale exports.
The PDF Association explains that a well-tagged PDF establishes predictable reading order for extraction and reuse. That is strong evidence when present, but software still has to use the tags correctly; when tags are absent or damaged, a visual comparison remains necessary.
Choose the repair that matches the failure
| Failure | Repair | Do not |
|---|---|---|
| Interleaved columns | Reorder complete paragraph blocks | Sort every line only by x/y position |
| Repeated artifacts | Remove verified headers or footers | Delete repeated sentences blindly |
| Caption detached | Place it beside the correct figure reference | Merge it into nearby body text |
| Bad OCR order | Re-run or manually edit with the image visible | Treat plausible prose as verified |
Correct reading order before downstream automation. A clean-looking Markdown file with the wrong sequence can produce coherent but false summaries, misleading RAG chunks, and table statements attached to the wrong section.
Official sources and evidence boundary
These links support format and platform behavior. pdfmd processing and point costs are governed by this site's pricing and privacy pages.
Keep the review checklist
Download the Markdown checklist and reuse it next time. Export-format changes are recorded in the public changelog.
Frequently asked questions
Why does a two-column PDF become scrambled Markdown?
The visible columns may not match the file's logical or content-stream order, so extraction can alternate between regions.
Does Tagged PDF always fix reading order?
Good tags provide intended order and semantics, but damaged tags or software that ignores them can still produce degraded output.
Should repeated headers always be deleted?
No. Confirm that the repeated line is a page artifact and not meaningful content before removing it.
When should reading order be checked?
Before summarization, RAG chunking, quotation, or any workflow that assumes adjacent Markdown was adjacent in the source.
Convert one difficult page and audit the sequence
Use a real multi-column or sidebar-heavy PDF. Cloud conversion requires Google sign-in and page points; compare the result with the original before exporting downstream profiles.