I expected this command to show 1/1
at the bootom of the generated pdf but no... any idea?
wkhtmltopdf --footer-center [page]/[topage] www.google.com /tmp/foobar.pdf
Version: 0.12.2.4 on Linux
I expected this command to show 1/1
at the bootom of the generated pdf but no... any idea?
wkhtmltopdf --footer-center [page]/[topage] www.google.com /tmp/foobar.pdf
Version: 0.12.2.4 on Linux
Seems like a stability issue but there has not been a stable release of the version 0.12.2.4
for linux
(debian
or ubuntu
) but just for the debugging purposes as mentioned in their repositories here.
Here is the working screen shot for the version
and 0.12.4
or you can add the page number by the following snippet to add the footer as mentioned here
<html><head><script>
function subst() {
var vars={};
var x=window.location.search.substring(1).split('&');
for (var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
for (var i in x) {
var y = document.getElementsByClassName(x[i]);
for (var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
}
}
</script></head><body style="border:0; margin: 0;" onload="subst()">
<table style="border-bottom: 1px solid black; width: 100%">
<tr>
<td class="section"></td>
<td style="text-align:right">
Page <span class="page"></span> of <span class="topage"></span>
</td>
</tr>
</table>
</body></html>
I think this issue may be due to version 0.12.2.4 otherwise, this
--footer-center [page]/[topage]
command will be doing your work.one more example i have checked that
substitutePdfVariables()
is called in body onload.Here Docs You can find out more variables about header and footer.