![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2025
Device: Kobo B&W
|
Unable to get page break to apply properly on an EPUB
Hey everybody,
I'm currently attempting to go from PDF -> EPUB -> EPUB, where I'm able to capture the large titles within the PDF and convert those into page breaks. Despite my best attempts, I am consistently unable to get the page breaks to to be generated, and I'm curious if somebody may know whether or not I'm making an obvious mistake. So the current idea was to convert the PDF -> EPUB with no page break settings, and then converting that new EPUB into a second EPUB with the page break adds since the formatting would be more consistent. The area looks like Code:
<p class="calibre1"><i class="calibre4">Blah blah blah ^ ^;</i></p> <p class="calibre1"><span class="calibre2">557. Episode 2. Rewrite (2)</span></p> <p class="calibre1">Blah blah blah blah</p> Code:
//p[re:test(span[@class='calibre2'], '.*episode.*', 'i')] such that it'll page break before the `episode 557`. Even attempting to manually put in 557 instead of `.*episode.*` doesn't seem to cause the page break to be created. Thanks for any help you may be able to provide! |
![]() |
![]() |
![]() |
#2 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,010
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
1. PDF is really only to view or print. Try fixing it in MS Word or LO Writer (extra Save As in Docx for conversion). Usually attempting to convert to epub is a failure.
2. The 100% way to have a page break is a new HTML file. That can be done manually or searching for suitable text and adding <h tags in the editor via regex search & replace <h2>Episode 2</h2> Then Editor split feature on h2 Forget direct conversion of PDF. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2025
Device: Kobo B&W
|
Yeah at the moment, the main change is to go from EPUB - > EPUB. That's why I'm able to get the above html. Is the regex I provided wrong for the epub?
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,457
Karma: 239219453
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
If you want to use a p tag for chapter headings instead of h, then specify in the css that the page must break before that tag. For example:
.calibre11 { page-break-before: always} |
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,182
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
The easiest way to do what you want is to convert the PDF to an epub with one big html file,then use the editor split funtion at your chapter heading.
bernie Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2025
Device: Kobo B&W
|
Quote:
I actually have already converted it to an EPUB, and oh hey, I didn't realize there was a splitter function in the editor, fantastic! You wouldn't happen to have a feel for if there's a way to automate this would you during the conversion process would you? |
|
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,457
Karma: 239219453
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2025
Device: Kobo B&W
|
Quote:
From my understanding, that requires that css to already exist within the html. I'm attempting to take advantage of the `insert page breaks before:` functionality in the convert page, using the xpath expression. Do you happen to have much experience with this? |
|
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,457
Karma: 239219453
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,182
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
https://manual.calibre-ebook.com/edi...ing-html-files
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#11 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2025
Device: Kobo B&W
|
Quote:
|
|
![]() |
![]() |
![]() |
#12 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,717
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
![]() |
#13 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,010
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
That doesn't work in all apps/ereaders. A file split always works unless an app is set to scroll and have no pages.
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,457
Karma: 239219453
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
|
![]() |
![]() |
![]() |
#15 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,736
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
Tags |
epub, pagebreak |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Firmware Update Kindle DX 2 G JB does not apply properly | Johnny666 | Amazon Kindle | 6 | 05-12-2020 02:31 PM |
page-break-before not responded to in any Epub reader | ivanbayross | ePub | 16 | 01-19-2013 06:33 PM |
page break in epub on iPad | JoanneM | ePub | 3 | 12-07-2011 09:59 AM |
mobi to epub - sections cause page break | sonyreaderfan | Conversion | 1 | 12-02-2011 04:17 AM |
Mobi to epub page break | mr.ninja13 | Calibre | 23 | 08-09-2011 02:06 PM |