GithubHelp home page GithubHelp logo

Comments (5)

johnfactotum avatar johnfactotum commented on July 4, 2024

I may be confused with another software, but I used to use this long ago.

You're probably thinking of the "Odd Pages Left" setting in Evince.

from foliate.

jancborchardt avatar jancborchardt commented on July 4, 2024

Currently the page layout for double pages always seems to be like this:

1 2
3 4
5 6

Which is not what any standard book does and thus it also destroys the layout of a spread/centerfold. Instead this would be correct:

Empty 1
2 3
4 5

Seems like this could be the default, without any offset setting needed, no?

from foliate.

johnfactotum avatar johnfactotum commented on July 4, 2024

As far as I can tell, yes, for PDF and CBZ, odd page recto should be the default. But the setting is still needed because a large number of documents require odd pages to be verso.

Not entirely sure about fixed-layout EPUB/Kindle books, though. I don't see a particular requirement in the spec and my interpretation has been that it should default to verso, and this is indeed what at least some books assume.

from foliate.

jancborchardt avatar jancborchardt commented on July 4, 2024

Not entirely sure about fixed-layout EPUB/Kindle books, though. I don't see a particular requirement in the spec and my interpretation has been that it should default to verso, and this is indeed what at least some books assume.

At least for the EPUBs which I have, all of them would look better with odd page recto as default. They have a cover page, which would be on the right side (or centered, or left) but definitely alone on the first 2-up view.
Then when you open the book you see page 2 left and page 3 right.

But yeah as you said, likely a lot of documents still require a setting anyway. However I would be curious to know if it’s really the majority of documents which do not assume a cover page?

from foliate.

johnfactotum avatar johnfactotum commented on July 4, 2024

With EPUB, it doesn't really have anything to do with cover pages. You're supposed to specify the page-spread-* properties. You can do that with the first page, or any page. Some books set it for every spine item to ensure that every spread would be correctly displayed.

The problem only arises when the EPUB fails to include this info. According to the spec, if you don't specify, it basically means that the spread placement is unimportant:

To indicate that two consecutive pages represent a true spread, EPUB creators SHOULD use the rendition:page-spread-left and rendition:page-spread-right properties on the spine items for the two adjacent EPUB content documents, and omit the properties on spine items where one-up or two-up presentation is equally acceptable.

I could be missing something, but it doesn't seem to say anything about the default placement of the first page. It only says,

When a reading system renders a synthetic spread, the default behavior is to populate the spread by rendering the next EPUB content document in the next available unpopulated viewport, where the next available viewport is determined by the given page progression direction or by local declarations within EPUB content documents.

But we should just do whatever other reading systems are doing. I might be missing something, but from testing with the file from koreader/koreader#6215, which doesn't seem to have any page-spread-* properties and has a blank page before the cover page, it would appear that both Thorium and Apple Books display the spreads correctly. If so then we should continue defaulting to verso page first for EPUBs.

A counter example is "The Real Mother Goose" from https://bbebooksthailand.com/samples.html. This books doesn't use the standard EPUB properties. Instead it relies on the proprietary open-to-spread property in META-INF/com.apple.ibooks.display-options.xml, which isn't supported by Foliate. If I have to guess, this is probably the reason why the EPUBs you have are displayed wrong. now fixed with johnfactotum/foliate-js@51c02bf.


It must be emphasized, though, that the above doesn't necessarily apply to KF8 (AZW3) files. Currently it will read the RESC record, which might contain the correct page-spread-* properties. But I'm not sure what the expected behavior would be if this is not available. From the KF8 version of "The Real Mother Goose" above, unlike the EPUB version, there's no cover page.

But from Amazon's guidelines, if you don't specify page-spread-* in the EPUB, it will default to page-spread-center, which means it won't render any spreads at all!


Anyway, the only way to be sure would be to prepare a bunch of test cases and open them with Apple Books, Thorium Reader, Kindle Previewer, etc.

from foliate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.