3 ms·
I tried using wkhtmltopdf for rendering my book https://www.handsonscala.com/ https://www.handsonscala.com/ to pdf, but in general I found it pretty buggy and u
by lihaoyi 6y ago
I tried using wkhtmltopdf for rendering my book https://www.handsonscala.com/ https://www.handsonscala.com/ to pdf, but in general I found it pretty buggy and unreliable. Lines of text would get split between pages, some CSS like flexbox didnt render properly, font sizes and page scaling was sometimes off (e.g. a big image on a page would make everything else shrink), etc. In general it "worked", but it didn't work well.
I ended up swapping in Google's Puppeteer library to render my PDFs, and despite needing a bit of plumbing to get my Scala build script talking to the node.js runtime (and I needed to do e.g. page numbers and table-of-contents extraction myself using Apache PDFBox) in the end it worked much better. Things looked the same in puppeteer PDF as they did in the browser, which is something I could never quite achieve with wkhtmltopdf
- captn3m0 6y agoI prefer pandoc for known-text-to-pdf, much more cleaner output.