Converting Markdown to PDF with Markdown PDF
You can use the Markdown PDF VSCode extension to easily convert a markdown file to PDF. It is a customizable tool with the benefits below:
- Supports custom css styles
- Easy to install as it's provided as a VSCode extension
- Highly customizable
How to convert
To convert a markdown file to PDF:
- Install the Markdown PDF extension in VSCode.
- Open your markdown file and then press CMD+Shift+P.
- Enter Markdown PDF and choose Markdown PDF: Export (pdf).
You can also specify your own CSS file. To do so:
Press CMD+Shift+P.
Enter Markdown PDF and choose Markdown PDF: Export (settings.json).
In the file that is opened, add a line as follows:
"markdown-pdf.styles": [
"src/vue.min.css"
]Replace
src/vue.min.css
with the actual CSS you want to use.infoThe Markdown Preview Enhanced extension uses a lot of CSS styles that are simple and pretty. To use a built-in css style of this extension, go to the following location to find the css files:
/Users/username/.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.6.10/node_modules/@shd101wyy/mume/styles/preview_theme