Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-18-2022, 01:49 AM   #1
jugaor
Enthusiast
jugaor began at the beginning.
 
jugaor's Avatar
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Location: Lima, Peru
Device: Kindle 10Gen / Kobo Aura HD / Nook STR
Page-breaks and (possible) bug in Android Webview

Hello everyone
(and apologies for my bad English… not my native language).

I've been experimenting quite a bit with page-breaks lately and have noticed a few issues:

1. In several places (including a recent post by RbnJrg) I've read that it should be used

Code:
  page-break-before: always;
  break-before: column;
as fallback, since "old" apps (CSS2) only recognize the first line, and "modern" apps (CSS3) the second discarding the initial one.
Although there are sites that insist that the second should be break-before: always/all, these don't work (or have stopped doing so).
The other one that does have a little support is break-before: page

BUT, as always, there are problems:
Google Play Books, Colibrio Reader and Pocketbook don't break with this combination, they only do so if the lines' order is reversed.
Although then Aldiko (Next), Lithium, Reasily and others don't do it.

I have done many many tests (even with the obsolete commands), giving the results I detail in the table.
[attached: 'break tests' epub and table pdf (The "S" is for "SÍ" = "YES")].
Spoiler:
Moon+ ('Preview w/ publisher formatting'), ReadEra, ReadMe, SupReader and many others only use "scroll" mode, so I don't include them.


2. I have also noticed some odd behavior in Android Webview based apps (from v102 onwards), such as Lithium/Reasily/Infinity…
If break-before:column is used, the paragraphs are broken down into multiple pages.
[attached: screenshots]


So, looking to fix issues 1 and 2:

Rather:
Code:
.nota {
  page-break-before: always;
  break-before: column;
}
I'm trying:
Code:
.nota {
  page-break-before: always;
}

@supports (break-before: column) {
  .nota {
    page-break-before: auto;
    break-before: column;
    break-inside: avoid-column;
  }
}

[attached: example 'simple notes' epub2 (epub3 has the same behavior). If an app uses the second key, the text will be green as a visual clue.]

It has the advantage of
a) work on those that don't read @supports (like Google Play Books and ADE… unfortunately, not Colibrio or Pocketbook)
b) avoid the Webview 102+ bug (and a double page jump in Lithium).

What do you think?
Do you see it as a reliable solution? Could it cause problems in the long run (if they ever fix the bug)?


TIA!

.
Attached Thumbnails
Click image for larger version

Name:	wv101.jpg
Views:	82
Size:	71.2 KB
ID:	198486   Click image for larger version

Name:	wv102.jpg
Views:	77
Size:	42.3 KB
ID:	198487   Click image for larger version

Name:	wv102+.jpg
Views:	74
Size:	79.4 KB
ID:	198488  
Attached Files
File Type: epub break tests MR.epub (10.0 KB, 58 views)
File Type: pdf breaks tests MR.pdf (105.5 KB, 61 views)
File Type: epub simple notes [padding] MR.epub (3.5 KB, 57 views)
jugaor is offline   Reply With Quote
Old 12-18-2022, 05:58 AM   #2
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 10,794
Karma: 83992591
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Well, we always start a new file when a page break is needed and totally avoid columns, so likely none of our ebooks are affected.

I can see there is a problem if you absolutely must have columns.

I do check ebooks on Lithium, Pocketbook, Aldiko Basic and Google Play Books all on Android.
Quoth is offline   Reply With Quote
Advert
Old 12-19-2022, 04:51 AM   #3
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,528
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
The properties to be used are:

Code:
.breakBefore {
  page-break-before: always;
  break-before: column;
  -webkit-column-break-before: always;
  break-inside: avoid-column;
  -webkit-column-break-inside: avoid;
}
You're right, PocketBook (only under epub3 and with the standart engine) and Colibrio don't honor them, but all others ereaders do (Gitden, Reasily, Lithium, OverDrive, Aldiko Next, BlueFire, InfinityReader, BookFusion (all of them for Android), Thorium (both Windows and Linux versions), Koodo Reader (both Windows and Linux versions), ADE (Windows), IceCream (Windows), Foliate (Linux), Calibre Viewer and the Sigil plugins Readium, Bibi and EpubJSReader. (Of course, I only cited apps and programs with support for epub3)

PocketBook employs RMSDK (ADE Legacy) to display epub2 ebooks and Webkit to display epub3. It must be using and ancient version of webkit because otherwise it should honor page-breaks under epub3. Let's hope that a new version of the app updates the engine.

Last edited by RbnJrg; 12-19-2022 at 04:56 AM.
RbnJrg is offline   Reply With Quote
Old 12-19-2022, 04:54 AM   #4
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,528
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Quoth View Post
I do check ebooks on Lithium, Pocketbook, Aldiko Basic and Google Play Books all on Android.
Use Aldiko Next to do your checks; it's the best version of all free Aldiko apps.
RbnJrg is offline   Reply With Quote
Old 12-19-2022, 06:43 AM   #5
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 10,794
Karma: 83992591
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
I only use Aldiko basic on the prehistoric 4.3″ Android 4 phone. I did use Bluefire for a while on that.

Actual checking is done with plugins etc in Calibre. The Android viewing is really just to make sure images are sane on small to large screens.

Last edited by Quoth; 12-19-2022 at 06:47 AM.
Quoth is offline   Reply With Quote
Advert
Old 12-19-2022, 10:35 AM   #6
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Quoth View Post
Well, we always start a new file when a page break is needed and totally avoid columns, so likely none of our ebooks are affected.

I can see there is a problem if you absolutely must have columns.

I do check ebooks on Lithium, Pocketbook, Aldiko Basic and Google Play Books all on Android.
^^^ Yeah, what he says. We create required breaks with new HTML files.

However, you seem, submitter, to be trying to force breaks mid-paragraph? Is that right? Doesn't that wreak havoc all by itself, never mind what reader supports which set of commands?

Hitch
Hitch is offline   Reply With Quote
Old 12-19-2022, 11:44 PM   #7
jugaor
Enthusiast
jugaor began at the beginning.
 
jugaor's Avatar
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Location: Lima, Peru
Device: Kindle 10Gen / Kobo Aura HD / Nook STR
Quote:
Originally Posted by Hitch View Post
Quote:
Originally Posted by Quoth
Well, we always start a new file when a page break is needed and totally avoid columns, so likely none of our ebooks are affected.

I can see there is a problem if you absolutely must have columns.

I do check ebooks on Lithium, Pocketbook, Aldiko Basic and Google Play Books all on Android.
^^^ Yeah, what he says. We create required breaks with new HTML files.

However, you seem, submitter, to be trying to force breaks mid-paragraph? Is that right? Doesn't that wreak havoc all by itself, never mind what reader supports which set of commands?

Hitch
Thanks for your replies.

Quoth, the books we work on are mostly fiction/educational: some may have hundreds of small footnotes. It seems more efficient to have them grouped in a single xhtml (or a few, when they are over 300k) at the end.

Hitch, I must have expressed myself badly. It is Android Webview itself (v102 and following, used by Lithium/Reasily) that breaks paragraphs into multiple pages (as seen in the screenshots). The proposed code tries to avoid that, precisely.
jugaor is offline   Reply With Quote
Old 12-20-2022, 12:08 AM   #8
jugaor
Enthusiast
jugaor began at the beginning.
 
jugaor's Avatar
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Location: Lima, Peru
Device: Kindle 10Gen / Kobo Aura HD / Nook STR
Quote:
Originally Posted by RbnJrg View Post
The properties to be used are:

Code:
.breakBefore {
  page-break-before: always;
  break-before: column;
  -webkit-column-break-before: always;
  break-inside: avoid-column;
  -webkit-column-break-inside: avoid;
}
You're right, PocketBook (only under epub3 and with the standart engine) and Colibrio don't honor them, but all others ereaders do (Gitden, Reasily, Lithium, OverDrive, Aldiko Next, BlueFire, InfinityReader, BookFusion (all of them for Android), Thorium (both Windows and Linux versions), Koodo Reader (both Windows and Linux versions), ADE (Windows), IceCream (Windows), Foliate (Linux), Calibre Viewer and the Sigil plugins Readium, Bibi and EpubJSReader. (Of course, I only cited apps and programs with support for epub3)
RbnJrg, thanks for sharing your code. I'm going to try it out carefully.

—Google Play Books (not in your list) is almost a must for our student audience, often with Android tablets/phones, who prefer its notes and multi-device sync capabilities. Sadly, your recommended order prevents the page jump from working. My idea of using @supports is to "hide" that part, so GPB only uses the first page-break.

—In the apps I have been able to test it seems redundant to use -webkit-column-break in addition to the canonical break (see PDF table).
Please can you point me which applications/readers require the former as mandatory?

Quote:
Originally Posted by RbnJrg View Post
PocketBook employs RMSDK (ADE Legacy) to display epub2 ebooks and Webkit to display epub3. It must be using and ancient version of webkit because otherwise it should honor page-breaks under epub3. Let's hope that a new version of the app updates the engine.
It was like that until recently. But it seems that the current version (5.35.259, Android) always uses the webkit engine (aka "Standard"), in both epub2 and epub3, unless "Adobe" is selected in the Settings.
I don't have access to a real PB reader, so I don't know how these behave now…


Gracias de nuevo, amigo!
jugaor is offline   Reply With Quote
Old 12-20-2022, 08:23 AM   #9
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by jugaor View Post
RbnJrg, thanks for sharing your code. I'm going to try it out carefully.

—Google Play Books (not in your list) is almost a must for our student audience, often with Android tablets/phones, who prefer its notes and multi-device sync capabilities. Sadly, your recommended order prevents the page jump from working. My idea of using @supports is to "hide" that part, so GPB only uses the first page-break.

—In the apps I have been able to test it seems redundant to use -webkit-column-break in addition to the canonical break (see PDF table).
Please can you point me which applications/readers require the former as mandatory?
Oh, would that we ALL had a big-ass list like that, which told us the minute requirements for each and every bloody software (or hardware) reader out there! That's why most of us who have formatting businesses simply own 10-15 devices and we test. That's about all you can do.

Moreover, the apps are constantly updated, so something that's correct on Monday may not be on Tuesday and so on.

At my shop, we tell folks that we'll guarantee the work on the major physical devices--Kindle, Nook, iOS Books app, Kobo--and NOT on software readers, for that very reason. I was once driven nearly bonkers by someone who wanted something to display a certain way in something like MoonReader and I put paid to that after that book.


But, good luck with it.

Hitch
Hitch is offline   Reply With Quote
Old 12-20-2022, 09:55 AM   #10
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,528
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by jugaor View Post

—Google Play Books (not in your list) is almost a must for our student audience, often with Android tablets/phones, who prefer its notes and multi-device sync capabilities.
Ahhh, I see you are working under epub2. I didn't have GPB in the list I posted because GPB doesn't support epub3 and I believed you were working under that protocol.

The "bug" you were watching under Reasily, Lithium, etc. is due those apps "understand" (because of the properties break-before: column and -webkit-column-break-before: always) that one is working with multi-columns and so, they apply the default value for the property column-fill, that is, "column-fill: balance".

Quote:
Sadly, your recommended order prevents the page jump from working. My idea of using @supports is to "hide" that part, so GPB only uses the first page-break.
It's ok; since GPB works only with epub2, you don't need -webkit-column-break-before or break-before. Those are properties from css3. With page-break-before is enough for GPB. Of course, if you also need to do compatible your ebook with Reasily, Pocket, Lithium, etc., etc., then you'll do need the css3 properties and the use of @support is a right way to do the things.

Quote:
—In the apps I have been able to test it seems redundant to use -webkit-column-break in addition to the canonical break (see PDF table).
Please can you point me which applications/readers require the former as mandatory?
So far, all the apps and programs of my list, don't need -webkit-column-break-before EXCEPT the Sigil plugins: Readium, Bibi and EpubJS. The potencial issue is that many apps are starting to use the Readium engine, and then they could need the -webkit property to force a page-break. So, I include "-webkit-column-break-before: always" just in case.

Quote:
Gracias de nuevo, amigo!
Nada que agradecer, acá estamos para aprender todos de todos.
RbnJrg is offline   Reply With Quote
Old 12-20-2022, 10:12 AM   #11
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 10,794
Karma: 83992591
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
I feel if I needed epub3 I'd do an app. We only use epub2 and let Amazon convert the epub2 to whatever.

It's better than mobi and epub2 works on everything (inc Amazon who has 92%+ of English and prefers epub upload).
Quoth is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paragraph breaks become page breaks when converting to mobi Allreader Conversion 6 07-19-2021 01:08 AM
Help with assigning correct page breaks and page numbers to a textbook [converting fr cateroseg Calibre 0 02-14-2018 10:32 PM
Android Kindle 4.1 breaks further page syncing? Oletros Amazon Kindle 43 09-13-2013 01:40 AM
epub to mobi h1 page breaks not starting on new page wannabee Conversion 4 08-02-2011 12:46 AM
Adding page breaks in Calibre breaks ePubcheck validation bookraft Conversion 16 03-01-2011 01:23 PM


All times are GMT -4. The time now is 09:36 AM.


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