Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 06-05-2021, 05:52 AM   #1
shlomikalfa
Junior Member
shlomikalfa began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2021
Device: PC
Question Creating headers from parent chapter and not section

Hi,
Converting .azw3 to PDF.

I need to get the parent chapter into a header but can't seem to be able to make it work using the JS like in the example

Code:
<header style="font-size:12px;">

<div style="display:inline-block;" class="even-page">
<div style="display:inline-block;width:1.2em;background-color: #f58234;">&nbsp;</div>
<div style="display:inline-block;" class="headertxteven">_TOP_LEVEL_SECTION_ _SECTION_</div>
<div style="display:inline-block;float:right;"><i>_PAGENUM_</i></div>
</div>

<script>
document.querySelector("div.headertxteven").innerHTML = document.querySelector("h1.chapterpTitle").innerHTML;
</script>

</header>
Any way to find a list of more global variables like bellow, or these are the only ones provided?

Code:
_TOP_LEVEL_SECTION_
_SECTION_
_PAGENUM_
Thanks plenty for this WONDERFUL software!
shlomikalfa is offline   Reply With Quote
Old 06-05-2021, 05:57 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 39,396
Karma: 17300000
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
All variables are described here: https://manual.calibre-ebook.com/con...verting-to-pdf

You dont have access to the DOM of the content in header/footer templates. The only data available is that provided in the variables listed at the link above.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
QObject::setParent: Cannot set parent, new parent is in a different thread thiago.eec Development 2 10-18-2019 11:38 AM
TOC section scope is not included in the parent chapter feraudyh Sigil 3 12-26-2016 06:02 AM
how to build toc when chapter headers are just images cybmole Sigil 17 04-02-2012 05:03 AM
what to do when chapter headers are images ?s cybmole Conversion 5 04-06-2011 03:02 PM
ABBY creating headers PieOPah Workshop 2 11-22-2009 01:05 AM


All times are GMT -4. The time now is 05:39 PM.


MobileRead.com is a privately owned, operated and funded community.