Last time I seriously tried wkhtmltopdf (three or four years ago, at a guess), it produced results entirely unsuitable for printing in quite a few ways: • It completely mangled the kerning, like it was ignoring the font’s kerning and then making it even worse by only placing characters to 1pt precision (at 600dpi, one dot is 0.12pt). (To clarify: I never actually measured it; this is just my rough guess as to what ma…
Using Web Technologies to Print a Book
21–30 of 69 posts
Re: Using Web Technologies to Print a Book
#22Phantomjs (and its ilk) are based on browser engines and just don't support this. Also I would love to be able to change layout or content based on where particular elements turn up.
Re: Using Web Technologies to Print a Book
#23Markdown → Pandoc → HTML → weasyprint → PDF works great, paged media support in weasyprint is good enough and much, much better than in wkhhtmltopdf.
Re: Using Web Technologies to Print a Book
#24Last time I checked (maybe 2 years ago?) there wasn't a good open source html to pdf workflow. Specifically page-numbers and anything else involved with paged media is a nightmare, the CSS standards in that regard are not implemented. There is "Prince", but it isn't OSS and rather expensive. Phantomjs (and its ilk) are based on browser engines and just don't support this. Also I would love to be able to change layout…
Re: Using Web Technologies to Print a Book
#25Last time I seriously tried wkhtmltopdf (three or four years ago, at a guess), it produced results entirely unsuitable for printing in quite a few ways: • It completely mangled the kerning, like it was ignoring the font’s kerning and then making it even worse by only placing characters to 1pt precision (at 600dpi, one dot is 0.12pt). (To clarify: I never actually measured it; this is just my rough guess as to what ma…
Puppeteer works perfectly https://medium.com/@raphaelstaebler/advanced-pdf-generation-...
Re: Using Web Technologies to Print a Book
#26Last time I checked (maybe 2 years ago?) there wasn't a good open source html to pdf workflow. Specifically page-numbers and anything else involved with paged media is a nightmare, the CSS standards in that regard are not implemented. There is "Prince", but it isn't OSS and rather expensive. Phantomjs (and its ilk) are based on browser engines and just don't support this. Also I would love to be able to change layout…
WeasyPrint supports CSS Paged Media and is open source. Yes, anything based on browser engines do not support CSS Paged Media.
Re: Using Web Technologies to Print a Book
#27Earlier quoted context omitted.
WeasyPrint supports CSS Paged Media and is open source. Yes, anything based on browser engines do not support CSS Paged Media.
WeasyPrint looks to have progressed a lot since last I looked at it (when there was no way I could use it at all, though I can’t remember the reason), but looks to still be quite limited. A couple of things that spring to my attention immediately: no flexbox, and no CSSOM (so that you can’t adjust the document based on layout at all unless you can do it in straight CSS). Still, in practice probably usable for what I…
Re: Using Web Technologies to Print a Book
#28 system("multimarkdown -s ../#{part}/story.md | sed -E 's/_([^_]+)_/\\1/g' | sed -E 's///g' | sed 's/%/%/g' > output-#{part}.html")
IMO: s_%
_%_g
is easier to read than: s/%/%/g
Any reason to keep the %-sign?Those sed commands could probably be reduced to one invocation of sed(1) instead of three.
system("cat #{htmls} | #{wkhtmltopdf_cmd} --footer-html footer.html - body.pdf")
No need to use cat.Re: Using Web Technologies to Print a Book
#29Last time I checked (maybe 2 years ago?) there wasn't a good open source html to pdf workflow. Specifically page-numbers and anything else involved with paged media is a nightmare, the CSS standards in that regard are not implemented. There is "Prince", but it isn't OSS and rather expensive. Phantomjs (and its ilk) are based on browser engines and just don't support this. Also I would love to be able to change layout…
WeasyPrint supports CSS Paged Media and is open source. Yes, anything based on browser engines do not support CSS Paged Media.
In general I think Tex/LaTex is the way to go in terms of reporting and generation of pdf. The biggest problem with Tex is that it is so different from HTML, and it gets progressively more different and difficult if you have specific layout or style requirements.
What I wish for is a replacement for LaTeX, based mostly on web standards, extensible in javascript... Unfortunately I don't have the resources to do that.
Re: Using Web Technologies to Print a Book
#30Earlier quoted context omitted.
WeasyPrint supports CSS Paged Media and is open source. Yes, anything based on browser engines do not support CSS Paged Media.
WeasyPrint looks to have progressed a lot since last I looked at it (when there was no way I could use it at all, though I can’t remember the reason), but looks to still be quite limited. A couple of things that spring to my attention immediately: no flexbox, and no CSSOM (so that you can’t adjust the document based on layout at all unless you can do it in straight CSS). Still, in practice probably usable for what I…
Basically every change to the CSS or DOM requires a reflow (or clever optimizations to avoid that).