epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

Rendition.display() switch to wrong page for ebooks with vertical text

Open Arvamer opened this issue 5 years ago • 8 comments

Instead of requested location, it display beginning of section (beginning of source xml file, after page break; not sure what terminology is used in epub.js). This bug can be observed on Kusamakura from epub3 samples. This particular sample have some more bugs related to switching pages, so if necessary, I could try to prepare more minimal epub.

To reproduce, open ebook with vertical text and go to page that is not beginning of section. After calling rendition.display(some_cfi_to_visible_text) it will wrongly show beginning of current section.

Arvamer avatar Jun 29 '20 20:06 Arvamer

Seems to happen with horizontal right-to-left books as well. Can reproduce with Israel Sailing from EPUB 3 Samples.

johnfactotum avatar Jul 02 '20 07:07 johnfactotum

I am having the same issue with rendition.display not showing the correct page for the input CFI. Anyone have an answer for this issue?

dannwise avatar Oct 04 '20 18:10 dannwise

I think I'm having the same problem. I grabbed the cfi at the start and end of my epub with

rendition.on('relocated', (location) => {
        console.log(location.start.cfi);
        console.log(location.end.cfi);
      })

and tested rendition.display(end_cfi) but it will still display the beginning of the section.

Tywele avatar Apr 08 '21 08:04 Tywele

Same issue, any fixes? Input CFI will always put me at the start of the chapter.

Umi-L avatar Mar 04 '22 02:03 Umi-L

related? #1277 However, regardless of this change, the display of Kusamakura was broken in my environment...

Screen Shot 2022-06-17 at 12 17 40

tjmtmmnk avatar Jun 17 '22 03:06 tjmtmmnk

It's been a while since I looked into it, but I seem to remember that Kusamakura being broken was in large part caused by its html having margin/padding/max-height set which Epub.js does not reset completely or take into account.

johnfactotum avatar Jul 04 '22 08:07 johnfactotum

@johnfactotum Could you review #1277 ?

tjmtmmnk avatar Jul 04 '22 08:07 tjmtmmnk

@tjmtmmnk

I get the same issue as you when I'm trying to use epubjs in npm. Can you help me to fix this?

yarnie046 avatar Jun 29 '23 08:06 yarnie046