How PDF-to-Word Paragraph Reflow Actually Works | PDFTeq
PDFTeq Engineering · Updated August 4, 2026
A PDF doesn't know what a "paragraph" is — it only knows where to place each character on the page. Converting it to an editable Word document means reconstructing that structure from positions alone. Here's the real logic our PDF to Word tool uses, and what it doesn't do yet.
The problem: line-by-line text
Copy text directly from a PDF and you'll often get a hard line break after every line, even mid-sentence — because that's literally how the PDF stores it: each line is a separate positioned string, not part of a continuous paragraph.
The real logic: vertical-proximity reflow
Our tool reads every text item's X/Y position and height, sorts lines top to bottom, and compares the vertical gap between each line and the next:
IF distance > (previousLine.height × 2):
→ start a new paragraph
ELSE:
→ same paragraph — merge the lines
(and fix a trailing hyphen if the line was split mid-word)
That's it — one threshold, two outcomes. It's simple, and it's genuinely what runs when you convert a file; we're not dressing it up as more than it is.
Basic two-column handling
Before reflowing, the tool checks whether text cleanly splits into a left half and right half of the page with nothing crossing the middle — a rough signal of a two-column layout. If so, it reads the left column fully, then the right column. This is a simple heuristic, not true layout analysis, so it can still get confused by three-plus columns, sidebars, or irregular layouts.
What this doesn't do
- No OCR — scanned or photographed PDFs (no real text layer) can't be converted; the tool will show an error rather than guess at the content.
- No formatting preserved — bold, italic, color, and font choices from the original aren't carried into the Word output; it's plain text.
- No table reconstruction — table content comes out as loose lines of text.
- Complex multi-column layouts may still come out of order.
Privacy
Everything above happens in your browser using pdf.js and docx.js — there's no upload step. You can confirm this in your browser's developer tools Network tab while converting a file.
Try the converter
Convert a PDFFAQ
It compares the vertical gap between lines to that line's text height — a gap more than twice the height starts a new paragraph.
No — there's no OCR built in. Only PDFs with actual selectable text will convert successfully.
Not currently — the output is plain text in Word.