I am generating complex user documentation using Markdown files and combining them with markedpp. I am currently using pandoc to convert to a DOCX file, but that requires some nasty hoop jumping in the Markdown to accomplish page breaks and such. I would prefer to generate a PDF, but every Latex to PDF converter barfs on the combined Markdown document saying there are too many sections. The Markdown is a combination of hand-crafted text and tool generated templates; simplifying it isn't going to be easy or cost effective.

Is there a good solution for creating print-oriented Markdown that renders to PDF that doesn't involve Latex or DOCX?

It can be either for Windows or Linux, I am running Windows 10 2004 with WSL2 enabled. Cost needs to be zero. I am doing this for a client and am trying to establish a repeatable process for all of our clients where project documentation is a mix of hand-rolled Markdown and auto-generated Markdown for database and code resources. Having the output be a generated PDF that can be digitally signed (signing will be manually done) to ensure integrity of the information within is a huge plus.

  • That's actually another question I have: Is there a set oif extensions to Markdown to add print-oriented features? Commented Jul 27, 2020 at 16:46
  • I've found a PowerShell module that will export PDF from DOCX using Office Interop, and it works great, but it still has the DOCX target in the middle, which I'd like to eliminate. Commented Jul 27, 2020 at 16:48
  • Did you ever have a look at doxygen, maybe this can be of use.
    – albert
    Commented Jul 28, 2020 at 12:54
  • 1
    Markdown to HTML to PDF. Some HTML to PDF converters handle print like features like section numbers and page numbers and cross references and tables of contents. I cannot remember if markdown has the problem that asciidoc has, of not supporting deep enough nesting when a lot of independent files are used to produce a bigger document, with the files of different levels.
    – Krazy Glew
    Commented Dec 21, 2021 at 2:55

2 Answers 2


You can create excellent pdfs using Report Lab, either the Open Source or Commercial versions of Report Lab. As it is the power behind the Wikipedia "Download as PDF" functionality it can definitely handle complex content.

It is used as a back-end by the python rst2pdf libary.

The simplest process, (lifted from the book Report Lab - PDF Processing in Python by Michael Driscoll), would be:

Mark Down Content -> Pandoc -> restructuredText -> rst2pdf -> PDF File.

This is the process that Mike used for his book.

Note: While I am credited in the above book I have no financial interest in it.

  • Which Markdown dialects does it support (note OP explicitly asked for Markdown)?
    – Izzy
    Commented Jul 27, 2020 at 16:07
  • Their site is not clear on it's markdown parsing abilities in the free version. Commented Jul 28, 2020 at 2:45

An alternative to combining markdown pages then generating PDF is to generate the seperate PDFs, then combine the PDFs. I know and like PDFsam for this task. For a command-line interface, PDFsam proposes the open-source sejda which is used internally as the library to make PDFsam work.

  • What tool generates the PDF from Markdown in your chain? Commented Jul 28, 2020 at 2:46
  • @TheSharpNinja pandoc should be fine
    – kutschkem
    Commented Jul 28, 2020 at 5:36
  • pandoc uses TeX to generate a PDF and I haven't found a TeX processor yet that doesn't barf on 40 pages of markdown. Commented Jul 28, 2020 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.