Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-21-2025, 06:24 PM   #1
stenagmois
Junior Member
stenagmois began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2021
Device: iPhone
Setting a header on conversion to PDF

I use h1, h2, and h3 tags. I have been setting the page header to _SECTION_ my h3 text, but it's not the right level for me. I would like to set _SECTION_ to my h2 content.

I would like to right justify that content and left justify a constant if possible.

I'm not sure if the htnl title property on the h2 or h3 would work for me.

I tried the _TOP_LEVEL_SECTION_ but that only picks up h1 and this is too high a level.

Thanks in advance
stenagmois is offline   Reply With Quote
Old 11-22-2025, 12:35 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: 45,681
Karma: 28549304
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You control what section titles are via the Table of Contents tab in the conversion settings.
kovidgoyal is offline   Reply With Quote
Old 11-23-2025, 11:34 PM   #3
stenagmois
Junior Member
stenagmois began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2021
Device: iPhone
Setting variables to use in a PDF header

Quote:
Originally Posted by kovidgoyal View Post
You control what section titles are via the Table of Contents tab in the conversion settings.
My question does not concern the table of contents, but the setting of the variable _SECTION_ which I want to have in the PDF Header on each page.

Is there documentation on how to set the value of the header variable _SECTION_ that you reference on the bottom of the PDF conversion page. Right now the _SECTION_ is being set by my usage of the h3 html tag. Is this the only way to do it? Is there a variable _CHAPTER_? set by the h2 tag?
stenagmois is offline   Reply With Quote
Old 11-24-2025, 01:49 AM   #4
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: 45,681
Karma: 28549304
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Once again, you control what becomes sections via the Table of Contents. Each entry in the table of contents corresponds to a section and thus sets the SECTION variable.
kovidgoyal is offline   Reply With Quote
Old 11-24-2025, 01:19 PM   #5
stenagmois
Junior Member
stenagmois began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2021
Device: iPhone
Thanks -- I can now set the section when I regen the TOC. Can I use <div> in the header and footer to out-justify two things, like series name on the left and chapter on the right of a single line? I tried this -- there must be a better way to count spaces!
<header><div style="width: 100%; margin:auto;">Series Name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _SECTION_ </div></header>
stenagmois is offline   Reply With Quote
Old 11-26-2025, 01:41 PM   #6
stenagmois
Junior Member
stenagmois began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2021
Device: iPhone
<header><div style="text-align: center; width: 100%; margin: auto;"><div>Music of the Bible</div><div style="text-align: right;">_SECTION_</div></div></header>

I woke up for a minute... This works fine.
stenagmois is offline   Reply With Quote
Reply

Tags
conversion to pdf, header


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobi conversion header issues gabryyl Conversion 3 12-26-2020 09:17 PM
Setting margins in conversion to PDF HarryT Conversion 2 06-22-2016 05:35 AM
Easy PDF ebook conversion. Eliminates header/footers wtw1936 Conversion 0 08-09-2011 11:44 PM
PDF Conversion - Removing Header / Footer Text heb Sony Reader 9 07-12-2010 12:02 AM
Header/Footer Problems with conversion Sydney's Mom Calibre 4 01-05-2010 12:04 PM


All times are GMT -4. The time now is 10:16 AM.


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