VSCode markdown-pdf: Header, Footer Template Configuration Sample Code

Tadashi Shigeoka ·  Tue, May 17, 2022

I’ll introduce sample configuration code for Header Template and Footer Template of the Visual Studio Code (VSCode) extension Markdown-pdf.

VSCode | Visual Studio Code

Background: Want to Insert Header/Footer with markdown-pdf

I researched how to configure Header and Footer display on each page using the VSCode extension Markdown PDF.

How to Configure Markdown-pdf: Header, Footer

Markdown-pdf: Header Template

Markdown-pdf: Header Template pdf only. HTML template for the print header.

Set the following:

<div style="font-size: 9px; margin-left: 1cm;"><span>codenote.net</span></div> <div style="font-size: 9px; margin-left: auto; margin-right: 1cm; "><span>Confidential</span></div>

Markdown-pdf: Footer Template

Markdown-pdf: Footer Template pdf only. HTML template for the print footer.

Set the following:

<div style="font-size: 9px; margin: 0 auto;"> Copyright © codenote.net 2022 All rights reserved. - <span class='pageNumber'></span> / <span class='totalPages'></span></div>

Above, I configured the Header Template and Footer Template for the VSCode extension Markdown-pdf.

That’s all from the Gemba.

Reference Information