simonhaenisch / md-to-pdf

Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
https://www.npmjs.com/md-to-pdf
MIT License
1.12k stars 108 forks source link

feature: option to import other files for headerTemplate #280

Open Ookamini95 opened 7 months ago

Ookamini95 commented 7 months ago

Problem: I'm using headerTemplate to generate a custom header for each page of my file, but since it contains an image and I'm using the cli I have a large blob of text from the data:image/png;base64 (using code this would be trivial to solve, just a couple of function calls and replacements, but that would go against the point of directly converting md to pdf).

Solution:

Simple solution would be providing the path of the headerTemplate/footerTemplate.html