Tag: pdf

Pacharapol Withayasakpunt Pacharapol Withayasakpunt
Tue, November 3, 2020

Let me say this first, the best way to create PDF from markdown is via web technology (Chrome / Puppeteer), because it is the closest to WSYIWYG (What You See Is What You Get), but it is not perfect.

It currently misses at least one PDF specific features (and possibly more) - Table of Contents / Bookmarks.

https://github.com/puppeteer/puppeteer/issues/1778

And one of the best tools to create PDF is Visual Studio Code, if you know how to use Markdown Preview Enhanced properly. (I've just noticed that I can use this in Atom as well.)

https://github.com/shd101wyy/markdown-preview-enhanced

Pacharapol Withayasakpunt Pacharapol Withayasakpunt
Mon, September 28, 2020

Indeed, the way includes

  • Don't just simply convert a HTML file to PDF, one-to-one. Otherwise, you can never control page breaks.
  • Nonetheless, HTML rendering will be web-browser dependent. (Therefore, not sure about Pandoc.)
  • CSS is powerful, but are there exceptions?

Therefore, I suggest a way of using a web driver + a PDF library, that can READ and MODIFY pdf.

The web driver is currently best either Puppeteer, or Chrome DevTools Protocol.