Reputation: 43300
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?
Upvotes: 1
Views: 2593
Reputation: 180
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
Upvotes: 1