I applied the following (and variants of it):
ebook-convert in.epub out.pdf --pdf-header-template '<header><div id="pagenum"></div><script>if (_PAGENUM_ > 5) document.getElementById("pagenum").innerHTML = "" + _PAGENUM_</script></header>'
The if condition seems to cause the mentioned errors.
The code given in the documentation works fine, e.g.:
'<header><div></div><script>document.currentScript.parentNode.quer ySelector("div").innerHTML = "" + (_PAGENUM_ + 3)</script> </header'
However, it only shifts page numbers. I want to remove them from the first pages.
|