Just Formatter
← Back to blog

doc to pdf

DOC to PDF Conversion: Preserve Formatting, Fonts, and Tables

2026-05-278 min read
Try it now — DOC to PDF ConverterOpen full screen →

Why DOC-to-PDF conversion is harder than it looks

DOCX files store content as XML with embedded formatting rules — paragraph styles, character runs, table grids, image positions, and page layout — all defined relative to each other. PDF files are fixed-layout: every element has an absolute position on the page. Bridging these two models requires a rendering engine that faithfully interprets DOCX styles and maps them to PDF coordinates.

Most fidelity problems trace back to font substitution, table column width calculation, or floating image anchoring. Understanding which category your problem falls into points directly to the fix.

Font embedding and substitution

The most common visual difference between a DOCX and its PDF export is fonts. If the font used in the DOCX is not available on the machine doing the conversion, the engine substitutes a fallback font. The fallback has different metrics — character width, kerning, line height — which shifts text across multiple lines and can break table cell widths.

The fix is to embed fonts. When converting with a server-side tool, install the required fonts on the server before conversion. For browser-based conversion (like Just Formatter), fonts are constrained to those available in the browser's font stack. Custom fonts in a DOCX should be substituted with the nearest standard web-safe font when the original is not installed.

  • Use standard fonts in your DOCX: Arial, Times New Roman, Courier New, Calibri, Georgia
  • Avoid system-specific fonts like Segoe UI (Windows) or San Francisco (macOS) in documents meant for cross-platform conversion
  • If your document must use a custom font, embed it in the DOCX before conversion
  • Verify the converted PDF on a different OS to catch substitution issues early

Tables: column widths and borders

DOCX tables can define column widths as fixed values (twips), percentages of the page width, or auto-fit based on content. Auto-fit tables are the hardest to convert because the rendering engine must calculate column widths by measuring cell content — a process that depends on the exact font metrics of the substituted font.

The safest practice for PDF-bound documents is to use fixed column widths in your DOCX. Open the table properties, switch from 'Preferred width: Auto' to a specific percentage or value, and verify the table looks correct at 100% zoom before converting.

💡

In Word or Google Docs, right-click a table → Table Properties → Column → set each column to a fixed width. This makes conversion predictable regardless of font metrics in the PDF renderer.

Images, charts, and inline objects

DOCX images have two positioning modes: inline (part of the text flow) and floating (positioned relative to the page or paragraph). Inline images convert reliably. Floating images are more fragile — their anchor paragraph can shift during conversion, moving the image to an unexpected position or page.

For reliable PDF output, convert floating images to inline before exporting. In Word: right-click the image → Wrap Text → In Line with Text. This anchors the image to a specific paragraph position and removes the floating layout calculation from the conversion process.

Lists, numbered sequences, and indentation

DOCX lists use a combination of paragraph indentation and list style definitions that can interact unexpectedly during conversion. Nested lists are particularly prone to flattening (all items at the same indent level in the PDF) when the converter does not correctly interpret the list continuation styles.

If your lists look wrong in the PDF output, try simplifying the list structure in the source DOCX: remove extra indentation, ensure each list level uses a consistent style name, and avoid mixing manual indentation with list styles in the same document.

Page breaks and section headers

Page breaks in DOCX can be explicit (a hard page break character) or implicit (defined by paragraph style 'Page break before'). Explicit page breaks convert reliably. Style-based page breaks sometimes fail to translate, causing content to flow onto a previous page or produce unexpected blank pages.

The safest approach: replace style-based page breaks with explicit ones before converting a document that will be distributed as PDF. In Word, this is done via Find & Replace with paragraph marks, or by inspecting Paragraph → Line and Page Breaks settings for each section heading style.

Testing your PDF output

After conversion, check these five things systematically before distributing the PDF:

  1. Font rendering — open the PDF on a different OS than you converted on; if fonts look different, there is substitution happening
  2. Table integrity — verify column widths, borders, and cell content are identical to the source DOCX
  3. Image positions — check floating images haven't shifted to a different page or overlapped text
  4. Page breaks — scroll through every section boundary; unexpected blank pages indicate a style-based break translation issue
  5. Headers and footers — verify page numbers, document titles, and dates are correct on every page

For production document workflows, keep a reference DOCX alongside each generated PDF. If a stakeholder reports a formatting issue, you can re-run the conversion immediately rather than reconstructing the source document.

Browser-based vs server-side conversion

Browser-based conversion tools like Just Formatter process the DOCX entirely in your browser using JavaScript libraries (mammoth for HTML extraction, jsPDF for PDF generation). This means no file upload, no privacy concerns, and no installation required. The trade-off is font availability: only fonts installed on your system and standard web fonts are available.

Server-side conversion tools — LibreOffice headless, Microsoft Word automation, or cloud APIs — have access to a wider font set and produce output closer to what Word itself generates. For documents with complex custom fonts or elaborate table designs, a server-side converter typically produces better fidelity. For standard office documents with common fonts, browser-based conversion is fast, private, and perfectly adequate.