1

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?

2
  • Your question is a little vague. You want another program which converts html to pdf? Commented 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 css Commented Apr 10, 2012 at 12:43

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.