-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change PDF generation engine to either wkhtmltopdf or phantom.js #1470
Comments
Since I wanted this badly, I've coded a PDF generator with wkhtmltopdf myself. Now it has a table of contents and some nice header/footer. Code and sample: vbnet_intro.zip Feel free to discuss and use the code if you're interested. |
@lwchkg
If I run I am on Windows 8.1 with node v5.12.0 and npm v3.8.6. Many thanks and best regards, |
@GeorgBraunHM Oh. I made the program with node 6. Maybe you can upgrade to node 6 and try again. |
Here's the updated sample and the generated PDF. The installation instruction is here:
and then run by As you may notice the SVGs in the above PDF are defective, and a few icons are missing. Personally I run with a modded GitBook myself to render the svgs (we don't need svg->png conversion) and added a real cover page. Here is the final product. :-) |
@lwchkg I have a few more questions, if you don't mind:
Many thanks and best regards, |
No pdf file generated:
I use the lastest code( (from Sept. 3), but run gitbook from docker container:
My Docker file looks like this:
|
@jonahfang Appears that you've forgotten to install wkhtmltopdf. It should be exist in your path. (Just a note: different people want to install different version of wkhtmltopdf, because none of them is really stable.) |
@lwchkg , thank you very much, it works. |
@lwchkg I will give the For GitBook 2.6.7, there is a flag In the meantime, I have applied your |
Tried with the option and indeed it works as intended. SVG are crips and part of the PDF (still tested with ebook-convert from Calibre) |
@lwchkg thanks so much for doing this! I FOUND AN NPM-INSTALLABLE VERSION HERE: https://github.com/lwchkg/gitbook-pdfgen |
I'm getting this error when using gitbook-pdfgen:
|
@oxid-filla You're likely running a very old version of node.js. Please update to a recent version. The error message indicates that your node.js installation doesn't support ES6. |
Ok, now it runs but two new problems.
I'm using an ordinary SUMMARY.md. |
Thanks for your zip. |
@MuyNooB Are you referring to me? Anyway the generator does only recognize ".html" in the output, so whether your content is ".adoc" or ".md" it shouldn't really matter. If you don't mind, you can send me the book so I can try to reproduce the error. BTW, this is the place for the official gitbook repository. If you're talking about my plugin, it's better to post an issue on https://github.com/lwchkg/gitbook-pdfgen/issues instead. |
@lwchkg |
FYI WeasyPrint now supports font-face and table of contents with page numbers, but I've not tried to use it yet. |
The current PDF generation engine, calibre, has too much limitations, e.g.
Proposed solutions
I've also heard a new product called WeasyPrint, but it does not support @font-face yet, so it is a turn-off.
Please discuss. Thanks!
The text was updated successfully, but these errors were encountered: