LWN: Comments on "Command-line publishing with Easybook" https://lwn.net/Articles/507809/ This is a special feed containing comments posted to the individual LWN article titled "Command-line publishing with Easybook". en-us Mon, 22 Sep 2025 18:39:01 +0000 Mon, 22 Sep 2025 18:39:01 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Command-line publishing with Easybook https://lwn.net/Articles/510391/ https://lwn.net/Articles/510391/ gidoca <div class="FormattedComment"> Thank you to everybody for your suggestions. I will check them out sometime. <br> </div> Thu, 09 Aug 2012 11:49:11 +0000 HTML/CSS to PDF software https://lwn.net/Articles/510011/ https://lwn.net/Articles/510011/ philomath <div class="FormattedComment"> Nice roundup. there is also htmldoc.<br> </div> Tue, 07 Aug 2012 13:36:46 +0000 HTML/CSS to PDF software https://lwn.net/Articles/508855/ https://lwn.net/Articles/508855/ pjm <p>Some other HTML-to-pdf software I know of that might be useful for e-book content:</p> <ul> <li> <p><a href="http://weasyprint.org/">WeasyPrint</a>. It was started with the intent of being easy to hack on, and use of css3-page things for page styling. The "easy to hack on" goal seems to have paid off fairly well, as they've made rapid progress over the last year, and supports more of css3-page (including pagination control) than I think any of the available free-software alternatives.</p> <p>Given the different priorities of WeasyPrint compared to wkhtmltopdf, you'd expect wkhtmltopdf to be much faster, but WeasyPrint is still pretty respectable at almost 5 pages a second on an i5 laptop — that's a lot faster than your printer. (wkhtmltopdf is indeed faster, at 30–50 pages a second, for those that need it; most other programs would be somewhere between the two.)</p> <p>It's a young product that still does things like truncate a float when it occurs near a page boundary, but if you have problems with it now then the progress it's made over the past few months makes me confident that it'll continue to get better over the next year or two. The hackability is a feature in itself: if you do find something missing, then you'll be more likely to be able to add it yourself with this software than any others that I'm familiar with.</p></li> <li> <p>Some more comments on wkhtmltopdf, beyond what's said above: wkhtmltopdf has become a much more viable option in the last year or so, especially if using the forked webkit engine with support for more page-control stuff. Older wkhtmltopdf/webkit was infamous for clipping text lines, but I haven't seen that happen in the current stuff (using the forked webkit). Last I saw, it still wasn't honouring 'widows' &amp; 'orphans' and 'page-break-before/after: avoid' (so you'll sometimes see a heading at the very end of a page), but I imagine that that sort of thing is being worked on, and might already be fixed for all I know.</p></li> <li><p>If HTML is only an intermediate format, then consider using some different intermediate for creating PDF. For example, Apache FOP, or one of the various docbook-based things, or reStructured text as mentioned in another comment. Many of these get really good output, better than any of the current free-software HTML/CSS options.</p> <p>A disadvantage of some of these is that you might not find it as easy to change the style of the output as the CSS-based approaches.</p></li> <li><p>I hope that in the future, that last niche might be filled by some software that I'm working on, to be called Morp. It uses CSS for styling, and already makes better pagination and line-breaking decisions than the other HTML/CSS-based pdf renderers I know of, as can already be seen in <a href="http://bowman.infotech.monash.edu.au/~pmoulder/redhat-docs/Red_Hat_Enterprise_Linux-5-5.6_Release_Notes-en-US.pdf">Morp rendering</a> of <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html-single/5.6_Release_Notes/index.html">http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html-single/5.6_Release_Notes/index.html</a> using a custom stylesheet for print-related things (using SVG images where available, and changing page headings, page margins and page numbering to match the <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/pdf/5.6_Release_Notes/Red_Hat_Enterprise_Linux-5-5.6_Release_Notes-en-US.pdf">corresponding Apache FOP output</a>, which is currently produced using a completely separate XSL-based stylesheet).</p> <p>(Apache FOP doesn't do font substitution, so it doesn't produce usable PDF output for Red Hat's Indic-language documents, so I maintain a directory of <a href="http://bowman.infotech.monash.edu.au/~pmoulder/redhat-docs/">Morp PDF output of the affected documents</a> (along with the corresponding English translation). I should also mention that Apache FOP doesn't like having a keep-together (page-break-inside:avoid) region longer than a page, which is why that directory also has the HTTP load-balancing documents even though they aren't Indic-language.)</p> <p>There's still work to do before it's a half-way usable product, but Morp might later become a good option for creating PDF e-books using CSS styling.</p></li> </ul> Tue, 31 Jul 2012 00:45:18 +0000 Command-line publishing with Easybook https://lwn.net/Articles/508752/ https://lwn.net/Articles/508752/ valhalla <div class="FormattedComment"> Personally I'm currently writing almost everything (article-lenght stuff and posts for my website, mostly) in reStructuredText and then using one of the many tools available to transform it.<br> <p> The best results for PDF generation are still those that go through LaTeX, and they may require some knowdlege of it for customisation (which works for me, since I come from that :) ), but people who don't know LaTeX can still ask somebody else for that bit of customisation and concentrate on writing the text.<br> <p> There are of course also tool to generate HTML and ePub, and also a ODT, which would then allow to generate .doc files for submission to traditional publishers.<br> <p> Most of those tools are written in python (a good number comes straight from docutils) and of course they don't have dependencies on proprietary software.<br> <p> I've been looking also for a toolchain based on pandoc, which is able to generate even more formats, but it's support for reStructuredText is still somewhat limited. On the other hand it is an alternative for people who would like to use markdown (it's "native" source format), and of course it is still totally free.<br> </div> Mon, 30 Jul 2012 07:34:45 +0000 Command-line publishing with Easybook https://lwn.net/Articles/508586/ https://lwn.net/Articles/508586/ dag- <div class="FormattedComment"> I would use AsciiDoc for writing the content as it supports the Simple DocBook functionality. AsciiDoc converts natively to HTML, and converts to epub and pdf through its a2x helper.<br> <p> For PDF output there are two options, either use DocBook+FOP, or asciidoc-odf to produce PDF output styled through LibreOffice.<br> <p> Since AsciiDoc is used nowadays for various O'Reilly books it is up to par with the requirements for printed material and digital formats.<br> </div> Sat, 28 Jul 2012 18:22:52 +0000 Command-line publishing with Easybook https://lwn.net/Articles/508386/ https://lwn.net/Articles/508386/ nix <div class="FormattedComment"> In the genre fiction publishing industry, at least, the entire workflow is based on Word 97--2003-format files (and features, such as change tracking).<br> </div> Fri, 27 Jul 2012 12:22:30 +0000 Command-line publishing with Easybook https://lwn.net/Articles/508369/ https://lwn.net/Articles/508369/ cmccabe <div class="FormattedComment"> It's interesting to know about another option. The PrinceXML dependency sounds like a real pain, though. I'm also not crazy about having to install a bundled version of PHP.<br> <p> I think if I were writing a book, I'd use TeX. There is a learning curve, but it's very powerful and stable. I know that TeX is used a lot by mathematicians and computer scientists, but I'm not too familiar with how widely used it is in the mainstream publishing industry. Does MS Word still prevail there?<br> </div> Fri, 27 Jul 2012 08:18:00 +0000 Command-line publishing with Easybook https://lwn.net/Articles/508290/ https://lwn.net/Articles/508290/ sciurus <div class="FormattedComment"> I expect that both the easiest and most correct way to build such a program is to reuse a browser's rendering engine. <a href="http://code.google.com/p/wkhtmltopdf/">http://code.google.com/p/wkhtmltopdf/</a> uses webkit, for example.<br> </div> Thu, 26 Jul 2012 20:06:20 +0000 Command-line publishing with Easybook https://lwn.net/Articles/508288/ https://lwn.net/Articles/508288/ jimparis <div class="FormattedComment"> I've been pretty happy with the webkit-based wkhtmltopdf. It does require an X11 server, but that doesn't mean you need a real display; I use Debian's xvfb-run wrapper to automatically run it inside xvfb. You can also build wkhtmltopdf against a custom-patched version of QT, which adds a bunch of features, including a fully X11-free workflow. There are some issues in areas like page breaks (which can be somewhat controlled with CSS), but overall it's decent. I use it to generate PDF invoices for a Ruby on Rails based webstore.<br> <p> <p> </div> Thu, 26 Jul 2012 20:00:19 +0000 Command-line publishing with Easybook https://lwn.net/Articles/508232/ https://lwn.net/Articles/508232/ anselm <p> I have similar requirements and I ended up using <a href="http://code.google.com/p/flying-saucer/">Flying Saucer</a>. It doesn't do vector graphics inclusion but the HTML-to-PDF conversion works reasonably well. </p> Thu, 26 Jul 2012 15:13:33 +0000 Command-line publishing with Easybook https://lwn.net/Articles/508206/ https://lwn.net/Articles/508206/ gidoca <div class="FormattedComment"> <font class="QuotedText">&gt; It is also a major strike against Easybook that its PDF export functionality comes from a proprietary library. There are certainly free software alternatives</font><br> I looked for FLOSS software that converts HTML to PDF back when I was developing a web application that needed to generate some PDFs. However, I didn't find anything that satisfied my needs. I didn't have very special requirements, just not-too-buggy CSS support, a possibility to insert or prevent a page break at a specific location, vector graphics inclusion (for the company logo), a possibility to integrate it into Rails, and that the tool doesn't depend on X11. In the end I settled on using prawn instead of generating from HTML, despite the fact that it is a nightmare for complex layouts. <br> </div> Thu, 26 Jul 2012 13:01:21 +0000