wkhtmltopdf header on every page
Asked Answered
E

2

8

I am using wkhtmltopdf to convert html to pdf.

I want to add header in every page, but it only shows up in the first page (table of contents). The command I am using is "C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe" toc --xsl-style-sheet default.xsl --header-html header.html http://a-url-to-a-page.com "some\folder\outputs\output-%time:~0,2%-%time:~3,2%-%time:~6,2%.pdf"

Any ideas?

Electrum answered 14/5, 2012 at 12:23 Comment(1)
You can answer your own question if you solve it :) wkhtmltopdf is particular about the order of arguments given.Clardy
S
6

(Solved by the OP and answered by a question edit. Transcribed here as a community wiki answer - although its a bit terse. See Question with no answers, but issue solved in the comments (or extended in chat) )

The OP wrote:

Finally solved, the problem was that --header-html should come before the table of contents related stuff...

@Nenotlep wrote:

wkhtmltopdf is particular about the order of arguments given.

Sneck answered 14/5, 2012 at 12:23 Comment(0)
L
0

--header-html Work fine, no issues..

  1. file:// not required.
  2. complete header tag should be in file

Note: https://github.com/KnpLabs/snappy/issues/97#issuecomment-137088664

Lujan answered 28/12, 2022 at 11:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.