Multi-column pages are one of the hardest cases in PDF-to-Markdown conversion. A person sees the left column, reads downward, then moves to the top of the right column. A basic extractor may instead sort every line by vertical position and alternate between columns. Each character is correct, but the article becomes unreadable.
The problem is not unique to one converter. PDF normally stores where text is drawn, not the intended reading sequence. Recovering that sequence requires geometric rules or a model that understands page layout.
Recognize the failure pattern
The most obvious symptom is alternating fragments: the first line from the left column, then the first line from the right, followed by the second line from each. Headings, captions, or sidebars may interrupt the main text at arbitrary points.
Other failures are subtler. A full-width title may be grouped with the right column. A pull quote may split a paragraph. Footnotes can appear between body lines because they share similar horizontal positions. On a three-column page, the center column may be attached to whichever neighbor has the smallest gap.
Before converting a large document, identify page types. Many reports use one column for the introduction, two columns for analysis, and full-width tables in appendices. Treating the entire PDF as a uniform layout usually produces inconsistent output.
Start with a page-level sample
Select three test pages: one ordinary two-column page, one page with a full-width heading or figure, and the most complex page. Convert these pages separately if your tool permits it. This makes errors easier to locate and prevents a good first page from hiding failures later in the document.
Compare the first and last sentence of each column with the Markdown. Confirm that the left column ends before the right begins. Then check whether headings remain attached to the section they introduce. Finally, inspect captions and footnotes, which often have smaller fonts and unusual positions.
Write down the observed rule. For example: “Pages 4–18 are two equal columns; page 9 contains a full-width figure; footnotes sit below a horizontal line.” A precise description helps whether you repair manually, write a script, or configure another parser.
Repair a small document manually
For a short document, manual block movement is often faster and more reliable than installing a model. Split the interleaved output at obvious sentence boundaries, collect the left-column fragments, then append the right-column fragments. Use the visible page to restore headings and captions.
Do not repair by guessing from topic continuity alone. Similar language can make a wrong order sound plausible. Check the actual source page, especially around numbered steps, legal clauses, and references such as “the following table.”
After reordering, remove running headers and page numbers, join lines that belong to one paragraph, and retain a separator only when the source has a meaningful section break. Keep a copy of the unedited extraction until review is complete.
Use geometry for repeated layouts
If hundreds of pages share the same two-column template, a deterministic script can be appropriate. Measure the page width and choose a vertical boundary between columns. Assign each text line to the left or right region using its horizontal center, then sort lines by vertical position within each region.
This works when columns do not overlap and the gutter is stable. Full-width titles need a separate rule: a block spanning the gutter should be emitted before the columns beneath it. Figures and tables may need to be detected as rectangular regions and handled independently.
Coordinate systems can be confusing because PDF and screen axes may have different origins and rotations. Test the rule on rotated pages and different page sizes. Never assume that every page uses the first page's dimensions.
Know when heuristics are insufficient
Magazine layouts, academic papers with floating figures, newsletters, and brochures may have too many exceptions for a fixed boundary. A page can contain a full-width abstract, two-column body, one-column conclusion, and marginal notes. At that point, layout detection is more useful than increasingly complicated conditionals.
Tools such as Marker and MinerU use heavier document-processing pipelines to identify regions and infer reading order. They are better candidates for dense scientific layouts, but they require installation, models, memory, and review. OCR may also be necessary if the columns are scanned images rather than text.
The choice is a cost decision. A deterministic browser converter is attractive for clean pages because it is immediate and private. A local model is justified when the cost of manual repair exceeds the operational cost of running and validating it.
Preserve Markdown semantics during repair
Reordering text is only the first task. Markdown headings must reflect the document hierarchy, not merely font size. Lists should remain continuous across a column break. A numbered list that continues at the top of the right column should not restart at one unless the source does.
Captions should sit next to a textual placeholder for the figure they describe. Footnotes should be linked or at least grouped consistently. Tables should not be flattened into prose if their row relationships matter; follow the PDF table conversion guide for that case.
Use blank lines deliberately. One blank line separates paragraphs, while hard line breaks should be rare. Joining every extracted line makes editing easier, but do not join separate list items or code samples.
A quality-control checklist
Review the start and end of every column on sampled pages. Search for repeated headers, isolated page numbers, and abrupt sentence fragments. Check cross-references such as “above,” “below,” “left,” and “right,” which reveal when a block moved away from its context. Verify numbered steps and citations in sequence.
For a long batch, inspect the first complex page, a random middle page, and the last page of each layout section. Record failures by page number. If error patterns change, split the document and use different extraction strategies instead of applying one global cleanup.
Finally, compare the repaired Markdown in a rendered preview. Visual headings, lists, and quotes make structural mistakes easier to spot than raw syntax alone. The Markdown cleanup guide provides a second-pass checklist after reading order is correct.
