How to Convert Markdown to PDF

Learn how to turn a Markdown file into a clean PDF, check headings, tables and links, and fix small problems in the exported file with OmniDoc.

A Markdown file looks fine in a text editor, but it often breaks once you need to send it as a page. Headings lose their size, tables run off the edge, and code blocks wrap in strange places. If you need a Markdown PDF for a client, a professor, a printer or a team that doesn't use plain text, you need a conversion step, not just a copy of the file.

This guide is for anyone who has a .md file, such as notes, a README, a report draft or meeting minutes, and needs a PDF that looks the same on any computer. It explains the general route from Markdown to PDF, the checks to run before and after, and how to fix small problems in the exported file.

You'll get a short answer, a step-by-step process and a checklist for the result. Where OmniDoc fits in: its PDF editor can change paragraph text and reorder, delete, rotate, split or merge pages in the file you export. That means you can correct a typo or move one page without converting the whole document again.

How do you convert Markdown to PDF? The short answer

Render the Markdown into a formatted page, save that page as a PDF, and then use a PDF editor for small fixes. The table below shows which step to use for each common situation.

Your situationWhat to doWhy
You only need a readable copy of the fileRender it in a Markdown preview or converter, then save the result as PDFHeadings, lists and tables keep their structure without a separate design step
The page size or margins are wrongSet them in the converter options or the print settings before you saveChanging them later can move line breaks and page breaks
One typo or heading is wrong after exportOpen the PDF in OmniDoc's PDF editor and edit the paragraph textFaster than rebuilding the whole file
Pages are out of order or one page is extraUse the page operations in the PDF editor to reorder, delete or splitThe rest of the document stays as it is

Before you start

A few checks at the beginning prevent most of the problems you will see at the end.

  • Save the source file as UTF-8. Accented letters, curly quotes and symbols can turn into question marks in some converters if the encoding is wrong.
  • Decide on page size and margins. A4 and US Letter produce different page counts. Choose one before you export so you don't have to check every page again.
  • Look for raw HTML and unusual syntax. Some renderers ignore embedded HTML or extended table syntax. If you find any, note it so you can check that part of the output carefully.
  • Keep images next to the .md file. Image links usually use relative paths, such as figures/chart.png. If the image sits in another folder, the converter may leave a blank space or fail.
  • Pick your route. A Markdown preview with a print-to-PDF option needs no extra software. A command-line converter gives you more control over styling, but you have to install and configure it first.

Converting a Markdown file to PDF, step by step

  1. Open the .md file in a text editor and read it once. Look for broken list indentation, unclosed code fences (lines of three backticks) and headings with no space after the # marks. Fixing these now is faster than debugging the PDF later.
  2. Render the Markdown. Use a Markdown preview in your editor, or a command-line converter that outputs HTML or PDF. Rendering turns the plain-text syntax into headings, bullet lists, tables and code blocks that a reader can see.
  3. Set the page size and margins. In the converter options or the browser's print settings, choose A4 or US Letter and set the margins. Doing this before you export keeps the line breaks and page breaks predictable.
  4. Save the output as a PDF. In a browser, open the rendered page and choose the print option, then select the option to save as PDF. With a converter, set the output file to PDF. Give the file a clear name, such as project-notes-v2.pdf, so reviewers know which version they have.
  5. Open the PDF in OmniDoc's PDF editor. If you don't have the desktop client yet, you can install it from download.omnidoc.top. Once the file is open, you can edit paragraph text in place, which is useful for fixing a typo or a wrong heading.
  6. Adjust the pages. Rotate a page that exported sideways, reorder sections, delete a blank page, or split the file so you send only the part a reviewer needs. You can also merge the PDF with a cover page from another file. If a reviewer needs an editable version, export the document to Word, Excel or PowerPoint from the same editor.

Check the result

Open the finished PDF and go through it page by page. The table lists the checks that catch a common problems.

CheckHow to see itIf it's wrong
HeadingsCompare each heading's size and position with its number of # marksFix the # marks in the source file and export again
TablesConfirm every row and column appears and no text is cut offReduce the font size or widen the page in the converter, or split a wide table into two
Code blocksCheck that long lines wrap or scroll cleanly and that symbols are intactShorten the longest lines in the source or use a smaller code font in the converter
Links and imagesClick a link and confirm each image appearsUse relative paths and keep images beside the .md file, then re-render
Edited textSearch the PDF for a word you changedEdit the paragraph in the PDF editor and save the file again
Page count and orderScroll through every page from start to finishReorder, delete or split pages in the PDF editor

❓ FAQ

1. Can I edit the text after I convert Markdown to PDF?

Yes. The PDF editor in the OmniDoc desktop client can edit paragraph text in place. Because a converted page often has a fixed layout, check each edited paragraph after you save, since a longer sentence can push text onto the next line.

2. Why do my code blocks look wrong in the PDF?

Code blocks usually break because a line is wider than the page. Shorten the longest lines in the source file or choose a smaller code font in your converter. Then export again, since the PDF editor is better suited to changing text than to resizing code.

3. Will my images appear in the PDF?

They will if the image paths are correct and the files are present when you render. Keep images in the same folder as the .md file or use relative paths, then check every image in the finished PDF.

4. Do I need to install software to make a PDF from Markdown?

Not always. Many Markdown previews let you print the rendered page to PDF through your browser, so you may not need anything extra. A command-line converter gives you more control over styling but requires installation and setup.

📝 Summary

Converting a Markdown file to PDF takes three steps: check the source, render it into a formatted page, and save that page as a PDF. Check headings, tables, code blocks and links before you share the file. For small fixes after export, the PDF editor in OmniDoc lets you change paragraph text and adjust pages without starting over.

Open OmniDoc to convert and tidy up your documents

Updated 2026-11-04