Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Markdown PDF PlusNew to Visual Studio Code? Get it now.
Markdown PDF Plus

Markdown PDF Plus

Tom Latham

|
3,342 installs
| (0) | Free
Export Markdown as PDF or HTML. You can include stylesheets and images, both local and remote.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Markdown PDF Plus

Export Markdown as PDF or HTML. Customize the output with CSS and images!

Commands

Export PDF

Export a Markdown file to PDF:

  1. Open the Markdown file in a VS Code editor.
  2. Open the Command Palette with Ctrl+Shift+P.
  3. Search for "Markdown PDF Plus: Export PDF" and select that option.
  4. Wait for the PDF to generate (5-10 seconds).
  5. Enjoy the finished product!

Demo:

Export PDF

Export HTML

  1. Open the Markdown file in a VS Code editor.
  2. Open the Command Palette with Ctrl+Shift+P.
  3. Search for "Markdown PDF Plus: Export HTML" and select that option.
  4. Wait for the HTML file to generate (1-2 seconds).
  5. Enjoy the finished product!

Demo: See the demo for Export PDF —— it's the same flow, except with the HTML command rather than the PDF one.

Extension Settings

This extension contributes the following settings:

  • markdown-pdf-plus.marginTop: The width* of the top margin of pages for exported PDFs.
  • markdown-pdf-plus.marginBottom: The width* of the bottom margin of pages for exported PDFs.
  • markdown-pdf-plus.marginLeft: The width* of the left margin of pages for exported PDFs.
  • markdown-pdf-plus.marginRight: The width* of the right margin of pages for exported PDFs.
  • markdown-pdf-plus.pageSize: The size of pages for exported PDFs. See the documentation for the size CSS at-rule descriptor, used with the @page at-rule, for more information.
  • markdown-pdf-plus.CSSPath: The path of the CSS file you wish to use to style exported documents. See the custom CSS documentation for rule-precedence details.
  • markdown-pdf-plus.CSSRaw: The raw CSS you wish to use to style exported documents. E.g., body { color: red; }. See the custom CSS documentation for rule-precedence details.
  • markdown-pdf-plus.outputHome: The path of the directory where you wish your exported file to be created (without trailing slash). If empty, defaults to the directory of the currently-open file when a relevant command is called.
  • markdown-pdf-plus.outputFilename: The filename under which you wish your exported file to be created (without any given extension). If empty, defaults to the name of your input file.
  • markdown-pdf-plus.usePageStyleFromCSS: Give any @page at-rule declared in CSS priority over the extension's default page settings.

*Available units include px, cm and in. See Mozilla's documentation on length units for more options

Page Customization (Margins, Page Breaks, Etc.) and Custom CSS

Please see the custom CSS documentation for details regarding styling exported documents.

In lieu of using the contributed extension settings, page properties of exported PDFs (e.g., margins, page size) can be customized via creating CSS that includes an @page at-rule and inserting that CSS into the PDF's source Markdown file. For a more detailed example please see the custom CSS documentation

Page breaks can be rendered in exported PDFs by inserting <div style="page-break-before:always"></div> into the source Markdown file wherever a page break is desired.

Known Issues

Exporting PDF overwrites HTML

  1. Export a Markdown file (my_file.md, for example) to HTML resulting in my_file.html.
  2. Make some changes to the Markdown file and save them.
  3. Export the same Markdown file to PDF, resulting in my_file.pdf.

Expected result: The changes made in step 2. should not be reflected in my_file.html.

Actual result: The changes made in step 2. are reflected in my_file.html.

Release Notes

See the changelog.

Third-Party Software

This product includes software developed by third-party sources. Please see the Third-Party Software section of LICENSE in the root directory for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft