How to convert markdown to PDF offline with Pandoc Converter
Find out how to convert or merge two or more markdown files into a pdf format in windows and MacOs using command line in Pandoc document converter.
In this post, we will see how to convert a markdown app to a pdf file with the Pandoc conversion tool.
Pandoc is an open-source document conversion tool that is used to convert files from one markup format to another.
Pandoc is available for Windows, Mac, and Linux.
Download Links for Pandoc
Using Pandoc, we can convert a markdown file into pdf, Docx, HTML, and many other formats. More details https://pandoc.org/index.html
Here, we will just convert a markdown file to pdf and even see how we can merge two markdown files together.
Convert markdown to PDF with Pandoc
To convert a markdown file (post.md) to a PDF document, we will use the following command
pandoc -s -o document.pdf post.md
So, this command will generate a PDF document named document.pdf as an output.
Merge two markdown files into one pdf document using Pandoc
We can also use pandoc to merge files too. Suppose we have two markdown files: article1.md and article2.md.
So to convert it into one pdf document, we will use the command:
pandoc -s -o document.pdf article1.md article2.md
Pandoc will merge and generate the document.pdf as the output in your directory.
So this is a very easy way to convert a markdown document to pdf offline using the command line in your windows, macOS, and Linux operating system.
Related Topics:
Related Posts
Checkbox inside GitHub Markdown Table
Short article on how to create checkbox or tick and cross mark inside markdown table in Github using emoji.
Easy Way to add Emoji in markdown with VS Code
Find out how to add emoji in your markdown document in VS Code using markdown emoji or emojisense plugins.
How to open markdown link in new tab
Article on how to open a markdown link in a new tab in browser using target="_blank" in the ahref link.
How to change image size in markdown in GitHub
Find out different ways on how to change or resize image size in markdown for GitHub profile. Learn to change markdown image size using CSS style.
