bharbron / hexbook-semantic

An Electron-React-Redux-Semantic-UI application for automatically generating a hexcrawl campaign notebook from random tables.
5 stars 3 forks source link

SPIKE: Investigate chromium --print-to-pdf option for generating our PDF #59

Open bharbron opened 5 years ago

bharbron commented 5 years ago

Stumbled across something recently. Apparently chrome/chromium/headless-chrome has a build in --print-to-pdf option which is designed to print/save an HTML page as a PDF. More importantly, it sounds like it might support some of the the CSS "printed media" options such as page breaks and columns.

This might not be as good as PrinceXML when it comes to "nice" layout (avoiding mid-block page breaks, etc.), but might be a much easier and "good enough" option to explore. And since ElectronJS runs inside an instance of Chromium, its an option that should be effectively "built-in" for us.

Do some investigation. Mockup some examples. etc.

bharbron commented 5 years ago

This article seems useful. A lot of good links about the state of CSS paged media support in browsers: https://www.smashingmagazine.com/2018/05/print-stylesheets-in-2018/