Mobileread
AZW3 Page-Break didn't work
#1  DropDeadAlex 03-03-2019, 07:43 AM
Hello guys!

I've researched a lot and tried so many ways, but I didn't find a way to use the CSS "page-break-before: always" property in a book in AZW3 format.

Does anyone knows if there is some limitation in AZW3 with that?

...my intention was to put a pageBreak() before each subchapter. The main chapters are already splitted in diferent .html files.
Reply 

#2  GrannyGrump 03-04-2019, 09:13 PM
How are you creating the azw3 file?
Do you begin with an epub, and convert? If you do that, and convert with kindlegen, or "Kindle Previewer for PC" which uses kindlegen, or convert with Calibre, I think the page-break-before should work.

I have converted epubs that way, and in the Kindle Previewer the page break does work. But I do not have a Kindle device to test it on.

Is your chapter wrapped in a <div> that has page-break-inside: avoid?
Reply 

#3  HarryT 03-05-2019, 03:22 AM
Quote GrannyGrump
How are you creating the azw3 file?
Do you begin with an epub, and convert? If you do that, and convert with kindlegen, or "Kindle Previewer for PC" which uses kindlegen, or convert with Calibre, I think the page-break-before should work.

I have converted epubs that way, and in the Kindle Previewer the page break does work. But I do not have a Kindle device to test it on.
It’s always worked absolutely fine for me on a Kindle. I just add the “page-break-before: always” to the CSS for whatever header level I’m using for chapter headings.
Reply 

#4  Hitch 03-06-2019, 02:56 PM
Quote HarryT
It’s always worked absolutely fine for me on a Kindle. I just add the “page-break-before: always” to the CSS for whatever header level I’m using for chapter headings.
Me too. never had a problem.

Hitch
Reply 

#5  theducks 03-10-2019, 09:16 PM
Me too

If it is not working, then there is a code (or conflicting code) problem.

<p class="Style1 Style2">

Style1 putith, Style2 taketh back

While it is valid to code that way, I prefer a single complete style.
Way easier to troubleshoot
Reply 

#6  AlanHK 03-11-2019, 06:38 AM
Quote DropDeadAlex
Hello guys!

I've researched a lot and tried so many ways, but I didn't find a way to use the CSS "page-break-before: always" property in a book in AZW3 format.

It would help if you cited the CSS and the HTML that uses it.

e.g.

.mbp_pagebreak {page-break-after: always; margin: 0; display: block}
Note this is page-break -after.

I think that is more reliable and the way mobis are usually coded.

invoked in a stand-alone line like
<div class="mbp_pagebreak"></div>


The Calibre viewer (ebook-viewer.exe) is useful to inspect mobi and AZW.
It's not a perfect previewer, but lets you select and "Inspect" text to see the underlying code and its interactions and change it to see the results, so you can work out if some other code has negated what you wanted.
Reply 

#7  GrannyGrump 03-11-2019, 10:24 PM
I just remembered when I had a problem with page-break-before: always--- it would not work in EPUB.
If the page-break was preceded by <hr/> (horizontal rule), it failed --- it needed to have TEXT preceding it.

see this thread:
https://www.mobileread.com/forums/sh...d.php?t=270007

Maybe the OP is having a similar glitch?
Reply 

#8  BettoReader 04-10-2020, 09:56 AM
Quote DropDeadAlex
Hello guys!

I've researched a lot and tried so many ways, but I didn't find a way to use the CSS "page-break-before: always" property in a book in AZW3 format.

Does anyone knows if there is some limitation in AZW3 with that?

...my intention was to put a pageBreak() before each subchapter. The main chapters are already splitted in diferent .html files.
If this can help you, after inserting in my azw3 the css rule
Code
page-break-after: always;
I had to carry out a reconversion on the same type (AZW3 -> AZW3).
Simply saving and copying the azw3 on the kindle I did not get the desired result (even if in the calibre viewer I got the page-break as expected).

So investigating I tried to reopen the reconverted AZW3 and I noticed that the html file was divided at the points where I wanted the page-break (perhaps in this way the kindle correctly detects the page-break).

In the book before the conversion I had ~ 80 html files and in the converted one ~ 140 html files.
Reply 

Today's Posts | Search this Thread | Login | Register