This extension convert Markdown file to pdf, html, png or jpeg file.
Supports the following features.
- Syntax highlighting
- emoji
- checkbox
- PlantUML
- Open the Markdown file
- Press
F1
orCtrl+Shift+P
- Type
pdf
and selectConvert Markdown to PDF
- Open the Markdown file
- Right click and select
Convert Markdown to PDF
- Add
"markdown-pdf.convertOnSave": true
option to settings.json - Restart Visual Studio Code
- Open the Markdown file
- Auto convert on save
Visual Studio Code User and Workspace Settings
- Select File > Preferences > UserSettings or Workspace Settings
- Find markdown-pdf settings in the Default Settings
- Copy
markdown-pdf.*
settings - Paste to the settings.json, and change the value
{
// Enable Auto convert on save
"markdown-pdf.convertOnSave": false,
// Excluded file name of convertOnSave option
"markdown-pdf.convertOnSaveExclude": [
"^work",
"work.md$",
"work|test",
"[0-9][0-9][0-9][0-9]-work",
"work\\d" // \d -> \\d. All '\' need to be written as '\\'.
],
// Output Directory
"markdown-pdf.outputDirectory": "C:\\work",
// A list of local paths to the stylesheets to use from the markdown-pdf
"markdown-pdf.styles": [
"C:\\Users\\<USERNAME>\\Documents\\markdown-pdf.css", // OK (Windows)
"C:\Users\<USERNAME>\Documents\markdown-pdf.css", // N/A. All '\' need to be written as '\\'. (Windows)
"C:/Users/<USERNAME>/Documents/markdown-pdf.css", // OK (Windows)
"/home/<USERNAME>/settings/markdown-pdf.css", // OK
".vscode\\markdown-pdf.css", // OK. Relative path (Windows)
".vscode/markdown-pdf.css", // OK. Relative path
"markdown-pdf.css.css" // OK. Relative path
],
// Set the style file name. for example: github.css, monokai.css ...
// fine name list : https://github.com/isagalaev/highlight.js/tree/master/src/styles
// demo site : https://highlightjs.org/static/demo/
"markdown-pdf.highlightStyle": "github.css",
// Enable Syntax highlighting
"markdown-pdf.highlight": true,
// Enable line breaks
"markdown-pdf.breaks": false,
// Enable emoji. http://www.webpagefx.com/tools/emoji-cheat-sheet/
"markdown-pdf.emoji": true,
// Output format: pdf, html, png, jpeg
"markdown-pdf.type": "pdf",
// Only used for types png & jpeg
"markdown-pdf.quality": 90,
// Page Option. Page size: A3, A4, A5, Legal, Letter, Tabloid
"markdown-pdf.format": "A4",
// Page Option. portrait or landscape
"markdown-pdf.orientation": "portrait",
// Page Option. Border Top. units: mm, cm, in, px
"markdown-pdf.border.top": "1.5cm",
// Page Option. Border bottom. units: mm, cm, in, px
"markdown-pdf.border.bottom": "1cm",
// Page Option. Border right. units: mm, cm, in, px
"markdown-pdf.border.right": "1cm",
// Page Option. Border left. units: mm, cm, in, px
"markdown-pdf.border.left": "1cm",
// Header contents
"markdown-pdf.header.contents": "",
// Header height. units: mm, cm, in, px
"markdown-pdf.header.height": "",
// Footer contents
"markdown-pdf.footer.contents": "<div style=\"text-align: center;\">{{page}}/{{pages}}</div>",
// Footer height. units: mm, cm, in, px
"markdown-pdf.footer.height": "0.8cm"
}
- Add the following to your stylesheet which was specified in the markdown-pdf.styles.
.emoji {
height: 2em;
}
- Add: Feature allowing use of PlantUML in a markdown document.
- Change: Display completion message on status bar #19
- Add: markdown-pdf.convertOnSaveExclude option #16
- Fix: broken code-blocks #18
- Fix: Image path error #14
- Update: markdown.css of the vscode
- Update: dependencies packages
MIT
- gmunguia/markdown-it-plantuml
- marcbachmann/node-html-pdf
- markdown-it/markdown-it
- mcecot/markdown-it-checkbox
- markdown-it/markdown-it-emoji
- HenrikJoreteg/emoji-images
- isagalaev/highlight.js
- cheeriojs/cheerio
- janl/mustache.js
and