3 ms·
Does converting to HTML first and then to PDF help?
by fforflo 2y ago
Does converting to HTML first and then to PDF help?
- deanebarker 2y agoThis is what I have done for a couple of books I wrote in Markdown (https://deanebarker.net/books/ https://deanebarker.net/books/). Convert to HTML, then use Prince (https://www.princexml.com/ https://www.princexml.com/) to style and convert to PDF.
- tnt128 2y agoTheir licenses are pretty expensive. Any good free open source alternatives?
- jessekv 2y agoIf it looks correct in a browser, then chromium + playwright.
- flowerthoughts 2y agoI don't know what the scope of this is, but https://pagedjs.org/ https://pagedjs.org/ is Javascript that does pagination and page margin styling. It's essentially a polyfill for CSS Paged Media: https://www.w3.org/TR/css-page-3/ https://www.w3.org/TR/css-page-3/ Pretty nice to work with, if you can run JS. (The rest is just Puppeteer to print. Though I couldn't use their command line tool, because it force-injects paged.js, and it didn't play well with the Preact components for previewing I had made.)
- deanebarker 2y agoI've only ever used a free version? I've never paid for it. I think it's free for personal projects? Or at least it was... Edit: I see it's $495 now. I don't think it was priced when I used it, but it's been 4-5 years.