How to set a first page to be displayed in ePUB format

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
VincentBevort
Posts: 90
Joined: Wed Mar 30, 2016 1:53 pm
Location: Stockholm, Sweden
Contact:

How to set a first page to be displayed in ePUB format

Unread post by VincentBevort »

Hi,

When generating CHM or Web help I get my first page when opening the help file.
When I open the ePUB generated from the same project I get the table of content.
My default viewer (Calibre) displays the table of content in a separate section in the same way as the CHM does.
How can I set the ePUB output to do the same as CHM displaying the first page instead of the Table of Content?
Senior Test Engineer & Technical Writer
Flowbird group
User avatar
Alexander Halser
EC-Software Support
Posts: 4106
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: How to set a first page to be displayed in ePUB format

Unread post by Alexander Halser »

How can I set the ePUB output to do the same as CHM displaying the first page instead of the Table of Content?
Short answer: you cannot. An ePUB ebook does not have a "default" page to start with. The default is in most cases the TOC or the cover page (if you add a cover page in the configuration). After opening an ePUB, most readers set an internal bookmark and remember the last page the reader was on.
Alexander Halser
Senior Software Architect, EC Software GmbH
VincentBevort
Posts: 90
Joined: Wed Mar 30, 2016 1:53 pm
Location: Stockholm, Sweden
Contact:

Re: How to set a first page to be displayed in ePUB format

Unread post by VincentBevort »

Hi alexander,

Was already afraid so.
Is there a way to generate the cover page in some way?
I do have a copyright page I like to include with some variables on it.

Including an image as cover page is strait forward but then I cannot display my variables.
This may an option for future development.
Senior Test Engineer & Technical Writer
Flowbird group
User avatar
julio
Posts: 118
Joined: Wed May 28, 2008 12:06 am
Location: Porto Alegre, RS - Brasil
Contact:

Re: How to set a first page to be displayed in ePUB format

Unread post by julio »

The ePub specification contains a file called content.opf, which is an XML file, and this file contains a <spine> element where you can configure the order in which all documents are displayed on the document, that is, the first <itemref> element inside the <spine> element is the one displayed when opening an ePub for the first time.
Of course I don't know how this specification is implemented in Help & Manual but it can be done 'manually' (no pun intended).
VincentBevort wrote:Hi alexander,

Was already afraid so.
Is there a way to generate the cover page in some way?
I do have a copyright page I like to include with some variables on it.

Including an image as cover page is strait forward but then I cannot display my variables.
This may an option for future development.
VincentBevort
Posts: 90
Joined: Wed Mar 30, 2016 1:53 pm
Location: Stockholm, Sweden
Contact:

Re: How to set a first page to be displayed in ePUB format

Unread post by VincentBevort »

Alexander & Tim,

Is this something for a future release?
julio wrote:The ePub specification contains a file called content.opf, which is an XML file, and this file contains a <spine> element where you can configure the order in which all documents are displayed on the document, that is, the first <itemref> element inside the <spine> element is the one displayed when opening an ePub for the first time.
Of course I don't know how this specification is implemented in Help & Manual but it can be done 'manually' (no pun intended).
Senior Test Engineer & Technical Writer
Flowbird group
User avatar
Alexander Halser
EC-Software Support
Posts: 4106
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: How to set a first page to be displayed in ePUB format

Unread post by Alexander Halser »

The ePub specification contains a file called content.opf, which is an XML file, and this file contains a <spine> element where you can configure the order in which all documents are displayed on the document, that is, the first <itemref> element inside the <spine> element is the one displayed when opening an ePub for the first time.
This is correct. Help+Manual creates the <spine> from the TOC, in the same order. So, the first topic in the TOC is always the default topic. Depending on the ePUB reader, however, the reader might decide to display the cover page first, or the table of contents.
Alexander Halser
Senior Software Architect, EC Software GmbH
VincentBevort
Posts: 90
Joined: Wed Mar 30, 2016 1:53 pm
Location: Stockholm, Sweden
Contact:

Re: How to set a first page to be displayed in ePUB format

Unread post by VincentBevort »

Hi,

Then I have an additional functionality request.

Make it possible to select the content of this spine
for me the following would work.
- TOC
- Default page
- topic selector

When I select the default page the ePUB opens with my Copyright page instead of the TOC
Senior Test Engineer & Technical Writer
Flowbird group
djkennek
Posts: 1
Joined: Thu Aug 10, 2023 11:48 pm
Location: Florida

Re: How to set a first page to be displayed in ePUB format

Unread post by djkennek »

Maybe things have changed over the years, but I solved the “first page to display” problem in my ePub file by replacing the one generated with the name of the xhtml page that I wanted to display. In the epub file I found OPS/contents.xhtml. Toward the bottom it had:

</ol>
</nav>
...............
<li>
<a epub:type="bodymatter" href="body16.xhtml">Start of Content</a>
</li>
...............
</ol>
</nav>

I replaced body16.xhtml with “ body9.xhtml” which is the page I want to appear first. As a test, I changed it to a different “body” file and it displayed that page first. I opened it on a Kindle and scrolling a few pages, closed it, and re-opened it. It resumed with the page I’d scrolled to, as I would expect. I’m not a techie so maybe there’s a “gotcha” waiting for me somewhere... I did not change OPS/content.opf or OPS/toc.ncx
Post Reply