View Single Post
Old 02-11-2013, 09:26 AM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I don't know what calibre does, but this script simply uses Prince to generate the PDF, and offers a way to add ad-hoc CSS rules. You can install Prince and test it (just Prince) with some HTML files to see if you like what you can get. In principle, Prince offers a better line-breaking algorithm, and some useful CSS extensions (to get real floats, footnotes, generated content, etc.), and hyperlinks are retained. The script just extracts the HTML files from the ePub and passes them to Prince in a command line. You could do the same yourself without python.

If I had enough time and motivation I could probably turn this into a calibre plugin (calibre is python too), but wouldn't mind others doing that either.
Jellby is offline   Reply With Quote