View Full Version : EPUB Headers & Footers?


Hamlet53
03-15-2010, 03:16 PM
Is there a way to add a header and/or footer to EPUB files that will display on each page of document displayed? Note I searched this forum topic and I read the discussion in this forum about the merits of having headers or footers in ebooks. It is not my intention to revive that debate. As was stated in the aforementioned discussion it is a matter of preference at the discretion of the EPUB file author. I know that according to the standards the CSS display element values oeb-page-head and oeb-page-foot should do this, but in practice not.

HarryT
03-15-2010, 03:26 PM
No, there isn't a way. As you note, the standard permits such a thing, but no current ePub reading software actually support it.

JSWolf
03-15-2010, 03:31 PM
I'm actually glad it doesn't work. It would be yet another thing to have to fix in an ePub.

charleski
03-16-2010, 05:25 AM
Adobe added an extension based on XSL:FO very early on in order to allow headers and footers. It's very poorly documented (one page (http://blogs.adobe.com/digitaleditions/template.html) of notes is all you get) and only implements a tiny subset of XSL:FO. Naturally, styling produced using this only works on ADE Reading Systems (though those represent the majority of portable devices). A large number of ebooks incorporate this file, though in almost every case it's simply a stock template that's been pasted in to allow two-column flows on wide devices. I suspect that very few who use it professionally actually understand how to make it do more than that.

I've attached an example which shows how to use it to create headers and footers IF YOU ABSOLUTELY HAVE TO USE THEM. Don't ask me why the footer keeps bouncing around - I think this extension is little more than a legacy now. Note that you need to keep repeating the head and foot in your text - I couldn't find a way to get around that. The styling uses Jellby's (http://www.mobileread.com/forums/showpost.php?p=744547&postcount=60) trick to stop them showing up on non-ADE readers.

jgray
03-16-2010, 05:37 AM
The funny thing is, the old Ebookwise reader supported page headers and footers via oeb-page-head and oeb-page-foot. So there really is no excuse for modern readers not to support it.

Madam Broshkina
03-16-2010, 07:55 AM
Headers (Title) appear on every page of a ePub file on the nook.

jgray
03-16-2010, 08:29 AM
Headers (Title) appear on every page of a ePub file on the nook.

That's not the same type of header. That is just that particular reader showing the title across the top. The jetBook and Libre do the same. What the OP was talking about was running headers/footers that are defined in the XHTML itself. This would allow any text to be displayed at the top/bottom of the screen and changed when desired.

As the OP and myself mentioned, the markup to do this is in the epub spec (and the even older OEB spec). It's just that none of the current epub readers support these statements. Personally, I would like to see these supported, with the added ability to disable their display as a user setting.

Hamlet53
03-16-2010, 01:28 PM
Thank you to all for confirming what I suspected and the additional information. I guess it comes as no surprise to the old web site designer that the standards say one thing and the actual implementation is a hodge-podge dependent on software and device.

DaleDe
04-21-2010, 02:46 PM
Adobe added an extension based on XSL:FO very early on in order to allow headers and footers. It's very poorly documented (one page (http://blogs.adobe.com/digitaleditions/template.html) of notes is all you get) and only implements a tiny subset of XSL:FO. Naturally, styling produced using this only works on ADE Reading Systems (though those represent the majority of portable devices). A large number of ebooks incorporate this file, though in almost every case it's simply a stock template that's been pasted in to allow two-column flows on wide devices. I suspect that very few who use it professionally actually understand how to make it do more than that.

I've attached an example which shows how to use it to create headers and footers IF YOU ABSOLUTELY HAVE TO USE THEM. Don't ask me why the footer keeps bouncing around - I think this extension is little more than a legacy now. Note that you need to keep repeating the head and foot in your text - I couldn't find a way to get around that. The styling uses Jellby's (http://www.mobileread.com/forums/showpost.php?p=744547&postcount=60) trick to stop them showing up on non-ADE readers.

I looked at the header+footer example in ADE on my Astak Pocket Pro and it works fine on all pages except those that have no paragraph break on the page. The pages without a paragraph break have all the extra margin but no data in the header or footer.

Dale

charleski
04-21-2010, 10:23 PM
I looked at the header+footer example in ADE on my Astak Pocket Pro and it works fine on all pages except those that have no paragraph break on the page. The pages without a paragraph break have all the extra margin but no data in the header or footer.

Dale

Yeah, that's the problem with the implementation I used there, it's not really workable. There might be a better way of doing it, but in the absence of any real documentation from Adobe I haven't bothered playing around with this mechanism further.

DaleDe
04-22-2010, 02:08 AM
Yeah, that's the problem with the implementation I used there, it's not really workable. There might be a better way of doing it, but in the absence of any real documentation from Adobe I haven't bothered playing around with this mechanism further.

Do you suppose the @page CSS can be used somehow to do this?

Dale

charleski
04-23-2010, 09:41 PM
Do you suppose the @page CSS can be used somehow to do this?

Dale

Hmm, can't think of any. For Adobe's method the work, you have to have text somewhere on the page that's being displayed which is tagged with the selector specified in the rules section of the template. That means this text has to be present on every page of the document.

I get the strong feeling that Adobe introduced the page template idea as a preliminary model back when the epub spec was still in flux and decided not to develop it any further when certain people made a big fuss about not wanting any sort of proprietary extensions (and, of course, this was a part of the whole css vs XSL-FO thing). While the idea of keeping the standard completely open is laudable, the standard has languished from neglect, partially as a result.