Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 03-03-2019, 07:43 AM   #1
DropDeadAlex
Member
DropDeadAlex began at the beginning.
 
DropDeadAlex's Avatar
 
Posts: 17
Karma: 10
Join Date: Apr 2014
Location: Brazil
Device: PW1, PW3
Post AZW3 Page-Break didn't work

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.
DropDeadAlex is offline   Reply With Quote
Old 03-04-2019, 09:13 PM   #2
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
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?

Last edited by GrannyGrump; 03-04-2019 at 09:16 PM.
GrannyGrump is offline   Reply With Quote
Advert
Old 03-05-2019, 03:22 AM   #3
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by GrannyGrump View Post
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.
HarryT is offline   Reply With Quote
Old 03-06-2019, 02:56 PM   #4
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,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by HarryT View Post
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
Hitch is offline   Reply With Quote
Old 03-10-2019, 09:16 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
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
theducks is online now   Reply With Quote
Advert
Old 03-11-2019, 06:38 AM   #6
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by DropDeadAlex View Post
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.
AlanHK is offline   Reply With Quote
Old 03-11-2019, 10:24 PM   #7
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
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?
GrannyGrump is offline   Reply With Quote
Old 04-10-2020, 09:56 AM   #8
BettoReader
Junior Member
BettoReader began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2020
Device: Kindle Paperwhite
Smile

Quote:
Originally Posted by DropDeadAlex View Post
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.
BettoReader is offline   Reply With Quote
Old 11-26-2021, 10:45 AM   #9
Arjayem
Casual Member
Arjayem began at the beginning.
 
Arjayem's Avatar
 
Posts: 5
Karma: 10
Join Date: Mar 2016
Location: UK
Device: Kindle paperwhite
Talking Page-break-before

Quote:
Originally Posted by BettoReader View Post
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.
Very interesting, I can’t get page-break-before to work, but every forum I read insists it should. But if as you say it needs something to generate a file break using the page-break-before then this sheds some light on the problem.
New file results in a page break, no problem, I’ve been using new file to give a page break, but find the number of files messy, particularly if the section is short.

Does this mean everyone claiming page-break-before works are wrong and “something” is just using the page-break-before to generate a new file
Arjayem is offline   Reply With Quote
Old 11-26-2021, 12:47 PM   #10
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: 11,157
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
All my new pages seem to start new files. Seems to be the only thing that works on KF7.

Long ago KDP told me to switch from docx to epub2 when the page breaks in KF7 and AZW3 (KF8) downloads vanished. That solved the problem as long as each page break was a new file. It doesn't matter how many files it makes as they are all in an outer "wrapper" anyway, a simple Zip for epub actually, so there is no file system fragmentation. The entire collection of "files" for mobi, azw3 or epub is one physical file.
Quoth is offline   Reply With Quote
Old 11-26-2021, 05:22 PM   #11
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,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Arjayem View Post
Very interesting, I can’t get page-break-before to work, but every forum I read insists it should. But if as you say it needs something to generate a file break using the page-break-before then this sheds some light on the problem.
New file results in a page break, no problem, I’ve been using new file to give a page break, but find the number of files messy, particularly if the section is short.

Does this mean everyone claiming page-break-before works are wrong and “something” is just using the page-break-before to generate a new file
Well, stoopid question (mine, I mean):

how are you deploying page-break-before:always?

Hitch
Hitch is offline   Reply With Quote
Old 11-26-2021, 07:10 PM   #12
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
page-break-before:always is supported by the Kindle platform. However there can be problems if you use calibre.

Enhanced Typesetting (KFX format) handles it by splitting the content into a new section (the KFX equivalent of a new HTML file) at that point.

Conversion using Amazon's kindlegen adds <mbp:pagebreak/> in MOBI7 and <div data-AmznPageBreak="always"/> in KF8 to make the page break actually function.

Conversion using calibre handles page breaks slightly differently. Calibre will change page-break-before:always into a split of the HTML file in KF8.

There is a bug in calibre's editor. It does not handle data-AmznPageBreak="always" properly resulting in broken page breaks if you attempt to edit a KF8 format book that was produced using kindlegen. Also you can't just add page-break-before:always into a KF8 book using calibre's editor since it does not convert it into data-AmznPageBreak="always" when you save the file.
jhowell is online now   Reply With Quote
Old 12-03-2021, 03:49 AM   #13
Arjayem
Casual Member
Arjayem began at the beginning.
 
Arjayem's Avatar
 
Posts: 5
Karma: 10
Join Date: Mar 2016
Location: UK
Device: Kindle paperwhite
Unhappy

Quote:
Originally Posted by Hitch View Post
Well, stoopid question (mine, I mean):

how are you deploying page-break-before:always?

Hitch

I have had a light bulb moment, and as with all light bulb moments you can't believe how stupid you've been.
What you see in calibre is not the azw3 as seen by calibre (doh!) Calibre converts the html you do see to azw3 format (obvious to me now) and calibre is not converting page-break- before (etc) into azw3 format page breaks. Calibre only converts new files to page breaks.
Not wishing to criticise such an excellent product as calibre, but as this is html supported by kindle it ought to be converted appropriately.
What I need is a different editor, but as this is my only gripe with calibre I won't bother, besides I can't find one at all let alone one that's better.
Arjayem is offline   Reply With Quote
Old 12-04-2021, 12:00 PM   #14
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,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Arjayem View Post
I have had a light bulb moment, and as with all light bulb moments you can't believe how stupid you've been.
What you see in calibre is not the azw3 as seen by calibre (doh!) Calibre converts the html you do see to azw3 format (obvious to me now) and calibre is not converting page-break- before (etc) into azw3 format page breaks. Calibre only converts new files to page breaks.
Not wishing to criticise such an excellent product as calibre, but as this is html supported by kindle it ought to be converted appropriately.
What I need is a different editor, but as this is my only gripe with calibre I won't bother, besides I can't find one at all let alone one that's better.
Uh, Sigil?

Why not just use Sigil to finish the book, if that's the only thing you're running into that bugs you? Use Sigil, get a final ePUB with your page-breaks in it and then drop that onto KP3. ???

Hitch
Hitch is offline   Reply With Quote
Old 12-05-2021, 12:49 AM   #15
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,586
Karma: 4300000
Join Date: Mar 2015
Device: Kindle, iOS
Quote:
Originally Posted by Hitch View Post
... Use Sigil, get a final ePUB with your page-breaks in it and then drop that onto KP3. ???
Or use Sigil with Doitsu's KindleGen plugin installed. When you're done editing ePUB to your satisfaction, run the KindleGen plugin to output an azw3, dual-mobi, KFX ... without ever leaving Sigil.
odamizu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you use page-break-after and page-break-inside? fluoresce ePub 14 05-24-2017 01:57 AM
Does page-break-inside:avoid work in azw3 files? AlexBell Workshop 4 04-21-2015 12:52 AM
'page-break-before|after: always' doesnt work sadhu44 ePub 18 06-18-2014 04:28 PM
Why didn't this regex work right? mrmikel Editor 1 04-12-2014 10:04 AM
Troubleshooting Help,My kindle didn't work. Please feiyangw Amazon Kindle 4 12-23-2011 04:49 AM


All times are GMT -4. The time now is 08:22 AM.


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