Header/Footer HTML Path
See original GitHub issueWhen using wkhtmltopdf
in command line, I can specify a local HTML file to use as the footer (or header):
wkhtmltopdf --footer-html .\footer.html .\content.html output.pdf
When I pass that reference in the options
variable:
options = {"footer-html":"footer.html"}
… PDFKit never works for me. Passing a url (mentioned here) does work:
options = {"footer-html":"http://google.com"}
Two questions:
- Is it possible to pass a reference to a local HTML file?
- If so, where does the file need to be relative to? I have tried relative and absolute paths, neither seem to work.
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Make header and footer files to be included in multiple html ...
I'd like to use javascript. Is there a way to do this using only html and JavaScript? I want to load a header...
Read more >Creating a Header/Footer to be Used on all Pages - Htmlcenter
The path you use in your include statement can be one of many different types of paths. The path can be relative to...
Read more >Add HTML Header or Footer - Encodian Support
HTML Header / Footer : The HTML fragment to embed within the location specified. Location: Set whether the HTML fragment should be added...
Read more ><footer> - HTML: HyperText Markup Language - MDN Web Docs
The HTML element represents a footer for its nearest ancestor sectioning content or sectioning root element.
Read more >Developers - Header/Footer HTML Path - - Bountysource
Header/Footer HTML Path. python-pdfkit. 13 September 2016 Posted by Gavin Rehkemper. When using wkhtmltopdf in command line, I can specify a local HTML...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@arasub I am facing same issue as @gavinr. I want to use a locally stored .html file in my generated pdf. When calling wkhtmltopdf on command line, I can use --footer-html file://path/to/file/file.html, but this does not work with pdfkit. I do not want to access the html via URL, but using file:// locally.
Seems working for me, tried with this:
Path handling is done by
wkhtmltopdf
but I think that it can handle both relative and absolute path, working directory for it is the same as the directory for python env.Feel free to reopen, but please provide a reproducible test case