Mobileread
page-break-after: always not working
#1  franc 02-28-2021, 09:20 AM
Hallo

I made some experiments in an ebook's css-file (an epub) with the css property "page-break-after" and "page-break-before" like this:

Code
...
.endofsite {	page-break-after: always;	}
.beginofsite {	page-break-before: always;	}
where I gave that class to a tag at the end (.endofsite) or the begin (.beginofsite) but never that makes any pagebreak in my ebook-Reader.
Tried it with calibre reader and MoonReader, neither are doing pagebreak.

Is there a way beside of creating a new html-file that my readers are doing a page break?

Thanks for hints.
frank
Reply 

#2  Turtle91 02-28-2021, 06:21 PM
Sorry, page-break-before/after are not supported consistently. The only way I am aware of forcing it is by having a new html page.
Reply 

#3  jhowell 02-28-2021, 07:06 PM
Quote Turtle91
Sorry, page-break-before/after are not supported consistently. The only way I am aware of forcing it is by having a new html page.
It does work in the calibre reader if coded correctly. I suspect that there is a problem with either the linking of the style sheet or calling out the class from the HTML.
Reply 

#4  GrannyGrump 03-01-2021, 06:54 AM
@ franc --- this may or may not be of help -----
If you are working with epub2, you might take a look at this old thread:
https://www.mobileread.com/forums/sh...d.php?t=270007

If you have a <hr /> or an empty <div> before the "beginofsite" class, you might get spotty results. I am not sure if the same problem would arise if you have <hr /> or empty div after "endofsite".
EDIT TO ADD --- Yes, I just checked --- same problem if <hr /> or empty div comes directly after "endofsite".

As RbnJrg pointed out, I had to add a <p> with some *text* in it before the page-break-before , even if that text was only a non-breaking space. You could set font-size to .05em to make it virtually invisible. You could also play with the display: none, or visible: hidden; although I never tried those, they might work to hide that paragraph if you need it hidden.

The book in question is posted here in the library
https://www.mobileread.com/forums/sh...d.php?t=270214

Hope you can get it worked out.
Reply 

#5  franc 03-01-2021, 08:53 AM
Quote Turtle91
Sorry, page-break-before/after are not supported consistently. The only way I am aware of forcing it is by having a new html page.
I guess this is the reason. It just doesn't work mostly

Quote jhowell
It does work in the calibre reader if coded correctly. I suspect that there is a problem with either the linking of the style sheet or calling out the class from the HTML.
No, doesn't work in calibre reader.
See my attached epub example. The class works, but not the page-break-after attribute.

Quote GrannyGrump
...
If you have a <hr /> or an empty <div> before the "beginofsite" class, you might get spotty results. ...
I read your thread but it doesnt work in my case.

Thank anyway!
frank
[epub] Pagebreak.epub (2.6 KB, 26 views)
Reply 

#6  jhowell 03-01-2021, 09:37 AM
Your sample works for me in the calibre viewer.
page1.jpg page2.jpg 
Reply 

#7  DNSB 03-01-2021, 12:13 PM
What version of calibre viewer and OS are you using?
Reply 

#8  jhowell 03-01-2021, 01:19 PM
Make sure that the calibre viewer is not in flow mode.
flow-mode.jpg 
Reply 

#9  franc 03-01-2021, 02:07 PM
Quote jhowell
Make sure that the calibre viewer is not in flow mode.
AHH! Sorry, that it is. Yes, then, calibre works then too
Sorry.

Flow mode is it.
I guess the MoonReader is the same thing, there too, there is a flow mode, which I love, because I can set an exact position of reading. Not many reader can do this.

So I guess then either flow mode or (soft) page break (with css) possible.

Many thanks!

PS.: Calibre 3.48 on Mac (last working on 10.11) and the last 4.x (because of DeDRM) on Windows 10.
Reply 

#10  JSWolf 03-01-2021, 03:41 PM
Quote franc
AHH! Sorry, that it is. Yes, then, calibre works then too
Sorry.

Flow mode is it.
I guess the MoonReader is the same thing, there too, there is a flow mode, which I love, because I can set an exact position of reading. Not many reader can do this.

So I guess then either flow mode or (soft) page break (with css) possible.

Many thanks!

PS.: Calibre 3.48 on Mac (last working on 10.11) and the last 4.x (because of DeDRM) on Windows 10.
You can run Calibre 5.x on Windows 10 because DeDRM 7.1.0 is no longer a test version. But if you share databases between your MAC and Windows, then you do want to stick with 4.23 because Calibre 5 changes the database and 3.48 is not compatible. 4.23 is compatible with the version 5 database.
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register