Reputation: 11150
Some questions for this very nifty tool, unfortunately lacking many usage examples.
wkhtmltox-0.11.0_rc1-installer.exe
, by running wkhtmltopdf --version
what should I read to understand whether my version is the reduced one or not?wkhtmltopdf *.html offline.pdf
. How can I set/specify the first PDF page from the *.html list? Currently they seem to be converted in alphabetical order.wkhtmltopdf toc http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf
I simply get a leading blank page, no TOC. What’s wrong? Thanks for helping
@Nenotlep:
Your TOC trick works perfectly.
As for the first page, I don’t need an actual cover. What I need is a way to download/convert a given page www.site.com/foo.html and all the linked pages (A.html, B.html ...) up to a certain depth level. Then I want a single PDF starting with foo.html and containing also the pages A.html, B.html ... (with relative links).
I don’t think there is an option to download and insert the linked pages in the final PDF (please, correct me if I am wrong). So I use httrack.com
to download and wkhtmltopdf to convert. Given the alphabetical behaviour of wkhtmltopdf, the best now seems to rename the target page, downloaded with httrack, something like !foo.html
.
Please, let me know of possible alternatives.
Upvotes: 4
Views: 12887
Reputation: 465
For part 3 of the question which is blank TOC, the latest stable version 0.12.5 also does not generate it. The pre-release version 0.12.6-dev has fixed this problem in Mac.
Upvotes: 4
Reputation: 13442
I think all available precompiled wkhtmltopdf's are compiled with the patched QT, they are not reduced. The reduced functionality means that it was compiled without a special patched version of QT. I use the windows version and it isn't reduced.
I think the cover
command line argument would work for you. I can't test at the moment, but try a command like wkhtmltopdf cover derpy.html toc --xsl-style-sheet default.xsl rarity.html twilight.html spike.html equestriadaily.pdf
At least in Linux, I think the asterix *.html simply explodes into all the html files before the command is performed, so if you select one html file for the cover and then do *.html in the same folder you will get the file twice. Getting around this issue might need some command line sorcery or a batch file or some other trickery.
This is a bug in wkhtmltopdf. The workaround is to manually set a tocfile. You can get the default tocfile with wkhtmltopdf.exe --dump-default-toc-xsl
. Then you can save the output as a file and use it like wkhtmltopdf.exe toc --xsl-style-sheet default.xsl www.stackoverflow.com so.pdf
.
Upvotes: 5