-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Inject your own content (css, footer, header, cover page) #19
Comments
Hi! Thank you for your questions, although most of your issues seems to be mdbook-specific, as you said, pdf generation is dependent on mdbook html generation, I will still try to help you as much as I can.
Actually I don't know if you can do that, I only know they do have themes supported. You can try to find your answer at mdBook Documentation, and if it's not possible, try to file a feature request here.
We do have header and footer template support, you can assign the corresponding file content to config. https://github.com/HollowMan6/mdbook-pdf/blob/main/test_doc/book.toml#L34-L35 However, as we just pass those parameters to Chromium https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF , I can't guarantee the rendering quality. You can file a issue at Chromium side if you are not satisfied.
Maybe, you can try to change the extension name from Unfortunately, this backend relies too much on third party tools, and the purpose of this backend originally was to generate pdf books in the CI so we don't need to print manually through Chromium. I think there will be few room for us to do any customization here. |
Hi,
I understand that the pdf generation is dependent on mdbook html generation. Let’s say I have an "external.css" css file, which includes all my styles with the media print.
How can I make it global so every pages generated by the mdbook have this style applied? If not possible, where in the mdbook can I modify the css beforehand ?
Let’s also assume that I have a file "header.html" and a file "footer.html" which are intended to represent the header and footer I want to put to each page (globally in the whole book) . How can I integrate it?
Finally, do you think it would be possible to add a cover page to this book, from an html file that contains the necessary css?
One should foresee the possibility of links for images in these html files. For example, for the cover page we could add a company logo, in the footer, we could add a logo for documentation... So it should be able to handle not only files but sources
I think there is plenty of use in this.
I tried to make an approach with wkhtmltopdf: https://github.com/Ange-Cesari/schedariu-rs
There must be something we can do here, unfortunately it's still kinda buggy because it needs the patched version of wkhtmltopdf.
The text was updated successfully, but these errors were encountered: