I'm in the middle of creating a html to pdf converter using the wkhtmltopdf application and having trouble trying to insert a custom header and footer to appear on the output document. For the program I am making this for I need these to be created within the html page that gets passed into the converter for packaging reasons. The wkhtmltopdf program won't accept the @media print css method so I was wondering if there was any other way in which this can be done within HTML,JavaScript, or CSS?
-
Your question is a little vague. You want another program which converts html to pdf?Neil– Neil2012-04-10 12:37:35 +00:00Commented Apr 10, 2012 at 12:37
-
my apologies.. the problem isn't with the pdf converter, its with the adding a header/footer to a web page to be displayed at the top and bottom of a page in a pdf (paper pages not web pages). I'm looking for a way to create these within a html document without using the @media print option in cssSayse– Sayse2012-04-10 12:43:35 +00:00Commented Apr 10, 2012 at 12:43
Add a comment
|
1 Answer
Use the --header-html and --footer-html options to pass in a URL or file path to the executable. Documentation
If you are linking to the library use the object settings header and footer properties:
settings.header.htmlUrl