09-22-2016, 06:19 PM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jan 2013
Device: none
|
ODT -> Pdf Headers but omit on some pages
I want to have headers on my pdf output but not on the first few pages. I’m have a little knowledge in Java Script and HTML and figure from the examples that this should be possible and quite simple but my skill level isn’t up to it. Maybe I’m not asking the right questions in my searching but I can’t find anything. Any help appreciated
|
09-22-2016, 08:07 PM | #2 |
null operator (he/him)
Posts: 20,598
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
IIRC PDF uses Postscript internally not HTML.
But maybe you don't need calibre to convert an ODT to PDF. One of the better features of Libre Office Writer is producing PDF's. In Word I would make use of a Section to suppress page numbers on the front matter pages. Writer has Sections, given Writer started life as reverse engineered Word '9? it's quite likely its Sections are a clone of Word's Sections. BR |
Advert | |
|
09-22-2016, 10:41 PM | #3 |
creator of calibre
Posts: 43,903
Karma: 22666668
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the following header template:
Code:
<p id="pagenum"></p><script>if (_PAGENUM_ > 5) document.getElementById("pagenum").innerHTML = "" + _PAGENUM_</script> |
09-23-2016, 06:02 AM | #4 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Jan 2013
Device: none
|
Quote:
Thanks, I should have explained a bit more, I want to take the example for title and author and put that in place of page (in your code above but I'm just not sure how to do it. Perhaps what I tried had some silly mistake but I couldn't get it to work Code:
<p style="text-align:right"><span class="even_page">_AUTHOR_</span><p style="text-align:left"><span class="odd_page"><i>_TITLE_</i></span></p> |
|
09-23-2016, 07:00 AM | #5 |
creator of calibre
Posts: 43,903
Karma: 22666668
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Code:
<p id="pagenum"></p><script>if (_PAGENUM_ > 5) document.getElementById("pagenum").innerHTML = _TITLE_ + " " + _AUTHOR_</script> |
Advert | |
|
09-23-2016, 08:29 PM | #6 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Jan 2013
Device: none
|
Quote:
Thanks, but, well I can get this to work Code:
<p id="pagehead"></p><script>if (_PAGENUM_ > 1) document.getElementById("pagehead").innerHTML = "Page "+ ( _PAGENUM_ -1) </script> |
|
09-23-2016, 11:07 PM | #7 |
creator of calibre
Posts: 43,903
Karma: 22666668
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You have to put the other properties in quotes, like this
"_TITLE_" because they are strings, not numbers. |
09-24-2016, 01:05 AM | #8 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Jan 2013
Device: none
|
Quote:
So this is what I ended up with, maybe there's a better way. It puts page headers alternating between author and title starting at page 3 Code:
<p id="pagehead" style="text-align:center; font-size:x-large"></p><script>if ("_PAGENUM_" >2 ) {if ("_PAGENUM_" % 2 === 0) {document.getElementById("pagehead").innerHTML = "_AUTHOR_" }else {document.getElementById("pagehead").innerHTML = "_TITLE_"}}</script><p |
|
09-24-2016, 01:39 AM | #9 |
creator of calibre
Posts: 43,903
Karma: 22666668
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
_PAGENUM_ must not be in quotes
|
09-24-2016, 03:05 AM | #10 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jan 2013
Device: none
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Classic Split PDF pages into smaller pages (images into tiles) | Astro | Barnes & Noble NOOK | 4 | 06-12-2020 10:56 AM |
PDF to doc/odt preserving table of contents | Tonttu | 4 | 05-12-2012 06:10 AM | |
Removing headers from pdf file | fotobox | Calibre | 2 | 08-30-2010 03:59 AM |
Evading headers in PDF->EPUB conversion | davef | Calibre | 6 | 08-29-2009 03:26 PM |
Remove PDF page headers ? | JohnB | Calibre | 9 | 03-27-2009 01:19 PM |