03-01-2018, 01:23 AM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Mar 2018
Device: Kindle 4th Gen
|
Add page breaks in Calibre
My Kindle (Paperwhite, 4th Gen) has broken . Half of the screen is 'blurred' with vertical lines, and is totally unresponsive. Tried to hard reset, no luck. Luckily, the top half of the screen (6.5 cm) works.
I am trying to make some use of it before I finally chuck it. I looked into swapping out the Kindle screen, but after some research it doesnt seem feasible. Rather, id like to format my Ebooks to make them readable on my defunct Kindle. I can see about 600 contiguous characters of text on the screen. Then the letters start to blur. So id like to make it so that each kindle page only shows 600 characters. After 600 characters, I would like to insert a page break. Then after 600 more characters, another page break. I would like to do this for all my books, so that they will be readable on my broken Kindle. Any Ideas on how to add page breaks, either in Calibre or Word or Acrobat? I've had some success adding page breaks on a short document in Word, but I had to literally count 600 characters and then click 'Insert Page Break'. The document was readable on my Kindle, but it would not be feasible to do this for a whole book. TLDR; Kindle broke; want to add page breaks to my books after each 600 characters of text. Thanks! Last edited by teresatenured; 03-01-2018 at 01:31 AM. |
03-01-2018, 07:09 PM | #2 |
You kids get off my lawn!
Posts: 4,220
Karma: 73492664
Join Date: Aug 2007
Location: Columbus, Ohio
Device: Oasis 2 and Libra H2O and half a dozen older models I can't let go of
|
Could you experiment with creating a large bottom margin and converting the book in Calibre with the new margins? I'm at work, or I'd test this idea before posting.
|
Advert | |
|
03-01-2018, 08:00 PM | #3 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
Copy and paste the following line after every 600 characters;
<p class="chapter"><p> Add the following to your .css file: .chapter { display: block; margin: 3em 0; page-break-after: always; } I would also combine all the html files that contain the text into one html file (right-click and choose merge files). Then convert the file. Calibre will split the "text" html file into a bunch of html files, beginning with each of the <p class="chapter"></p> lines (the class "chapter" alerts conversion to split the file at that point). You really don't need the page-break-after: always; line in the .css file, but it won't hurt to include it. Conversion will delete that line during the conversion. Last edited by deback; 03-01-2018 at 08:16 PM. |
03-01-2018, 08:06 PM | #4 | |
Addict
Posts: 281
Karma: 7724454
Join Date: Sep 2017
Location: Bethesda, MD, USA
Device: Kobo Aura H20, Kobo Clara HD
|
Quote:
In Calibre's editor, regex search for: Code:
(?ms)(.{600}.*?)<p class="para"> Code:
\1<p class="para break"> This will search for 600 characters (but includes code characters as well as displayed text), and then find the next <p class="para"> and turn it into a para/break tag. The ? here is to make the prior expression non-greedy, so you find the shortest possible distance to the next tag (regexes default to longest possible). If things are heavily marked up it won't be very accurate, and you may want to dial it down to 500 or so because it looks ahead for the next paragraph after the 600 characters are up (rather than creating a new paragraph break mid-paragraph). Or you could use "\. " instead of the '<p class="para">' search (untested, but something like that) and do a replace of Code:
\1. <div class="break"></div> |
|
03-01-2018, 11:44 PM | #5 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Hmm, how about using Print to PDF via Calibre Viewer? Say B6 paper size with a large bottom margin?
|
Advert | |
|
03-02-2018, 12:33 AM | #6 |
Junior Member
Posts: 3
Karma: 10
Join Date: Mar 2018
Device: Kindle 4th Gen
|
FizzyWater - That's a good idea! I'm not sure how I would do that though. Any Ideas?
deback - There's absolutely no way I'm counting 600 characters manually for a whole book. I might as well just read it on the Calibre editor at that point. sjfan - Good Ideas; unfortunately neither of your methods worked. One thing I noticed was that all the body-paragraphs are class="indent" . So I tried Code:
(?ms)(.{400}.*?)<p class="indent"> Code:
\1<p class="para break"> Your second replacement method (\.) did produce some changes, but not anything desirable. Some of the document was formatted as the original, while seemingly every other paragraph was randomly centered and indented. And still the EBook was displayed on the full screen of the Kindle, instead of only the top half the screen. This was just one book, and maybe it would be different with others, but unfortunately it did not work. Thanks for the effort though! Any other ideas? |
03-02-2018, 12:52 AM | #7 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
You need to define "para break" in the CSS to get it to do something.
If you want to skip all that, using <p class="chapter"><p> as recommended by deback should do the trick. This is what I'd do: Search Code:
(?ms)(.{400}.*?)(<p[ >]) Code:
\1<div class="chapter"></div>\2 Code:
\1: .{400}.*? \2: <p[ >] Last edited by ilovejedd; 03-02-2018 at 12:57 AM. |
03-02-2018, 02:01 AM | #8 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
If we were talking about an epub reader, I would suggest using the @page CSS rule. With that, you could set the bottom margin if the page to whatever was needed to prevent anything from being displayed in the bad section of the screen. Something like the following would probably work:
Code:
@page { margin-bottom: 3cm } I don't use a Kindle, so I don't know what would happen if you converted an epub that has the above to a Kindle suitable format. |
03-02-2018, 02:43 AM | #9 | |
Addict
Posts: 281
Karma: 7724454
Join Date: Sep 2017
Location: Bethesda, MD, USA
Device: Kobo Aura H20, Kobo Clara HD
|
Quote:
Second, did you do this as well like I said? And make sure the "break" style has "page-break-before: always" set. Just adding a non-existent "break" style isn't going to do anything; you need to define that style in the CSS to insert the breaks. Also, you don't want to rewrite your indent style to a nonexistent para. The replace-with should be Code:
\1<p class="indent break"> |
|
03-02-2018, 03:15 AM | #10 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you want to set margins, you can do it via the Page setup section of the conversion dialog.
|
03-02-2018, 03:33 AM | #11 |
Resident Curmudgeon
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
If you can afford it, I suggest buying a new Reader.
|
03-02-2018, 04:09 AM | #12 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
|
03-02-2018, 07:23 PM | #13 |
Junior Member
Posts: 3
Karma: 10
Join Date: Mar 2018
Device: Kindle 4th Gen
|
sjfan - Sorry, i should have mentioned that I'm pretty dumb when it comes to anything computer related. Where would I even add
"And make sure the "break" style has "page-break-before: always" set."? ilovejedd - You are amazing ! A solution that even I could figure it out. It worked for some of the books I've tried, but not all. Even when it works though, some of the longer paragraphs bleed into the broken part of the screen. I tried playing with the values (300, 350, etc), but still. I don't have any insight into why this happens though. and what do I do with this? Code:
\1: .{400}.*? \2: <p[ >] davidfor, kovidgoyal - Thanks for the response. I have relatively limited experience with CSS but I did try editing the margins with @page (in pixels). I saw no change. As well, when I edited the margins via Page Setup, i could only increase the bottom margin up to 200 pixels. I tried this, but because the text still bled into the broken portion of the screen, I could not tell if it made a difference. Thanks for the effort though! |
03-02-2018, 09:48 PM | #14 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
|
Tags |
calibre, delimiters, kindle, page break |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre unwanted page breaks | ebookscovers | Conversion | 20 | 05-03-2017 02:10 PM |
MOBI to EPUB conversion in calibre adds page breaks | waynn | Conversion | 15 | 04-05-2017 03:05 PM |
Mobi page breaks in Calibre viewer | DaleDe | Calibre | 3 | 04-04-2011 01:58 AM |
Adding page breaks in Calibre breaks ePubcheck validation | bookraft | Conversion | 16 | 03-01-2011 01:23 PM |
Force Calibre not to add Page Breaks on H1 and H2 Tags | jloakes | Calibre | 2 | 11-18-2010 04:08 PM |