![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Sep 2025
Device: Kindle 10th Generation Paperwhite
|
Calibre tidy line breaks
I have an annoying problem that even after converting books in Calibre editor, some are riddled with random line breaks. Can someone advise me on how to fix without having to manually go through the HTML editor. Is there a code/regex/plug in. TIA. Apologies if this should be on another thread.
|
![]() |
![]() |
![]() |
#2 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,140
Karma: 148951761
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
You could use regex to combine lines that do not end in a punctuation mark. That would help a lot. Read this thread, It gives a lot of good information including link(s) to regex to use. https://www.mobileread.com/forums/sh...d.php?t=357635 |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,725
Karma: 242197301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
A crappy conversion from PDF will always be a crappy conversion, unless you fix everything by hand, line by line. PDF is not a suitable format for conversion.
TL;DR Don't convert from PDF if you can do it in any other way. |
![]() |
![]() |
![]() |
#4 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Sep 2025
Device: Kindle 10th Generation Paperwhite
|
Thanks
Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Sep 2025
Device: Kindle 10th Generation Paperwhite
|
Thanks, as I said above, just checked and it was an EPUB, definitely not a PDF conversion.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,140
Karma: 148951761
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
@Globe Trotsky
Careful how you answer the question "Where did the epub come from". It has no bearing to your original question on how to fix the problem. There be wolves among the sheep. |
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,725
Karma: 242197301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
If it's a bad PDF conversion (and it almost certainly is, by the looks of it), there's no fixing it.
|
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
If you are prepared to read and fix at the same time, it can be done. Even easier if the original book is available as a reference. A few regex to catch the split sentences are easy enough. It's all the other annoying missing italic, replaced characters, broken words and spurious code that are more difficult/impossible to bulk fix. (not idea why an edit to my post caused a second post to appear) |
|
![]() |
![]() |
![]() |
#10 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 47,239
Karma: 171291590
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,856
Karma: 30277270
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
It's almost certainly a low quality OCR image scan of ink on paper (probably with an ancient version of ABBYY - probably pirated), that was saved as a PDF.
Professionally created PDFs using Acrobat, DTP (InDesign, even Quark), or WP (MS Word, LO Writer, WordPerfect) don't break paragraphs like that. One way to deal with it, is to convert to txt, open with a decent text editor (e.g. Vim, Text Pad, Notepad++) and correct using regex. Then open the corrected text file in one of the WP apps mentioned above, style front-matter, headings, bibliography etc as appropriate and save as DOCX and get calibre to convert that to EPUB. If you use Wordperfect you can save as EPUB directly, which does a better job of mapping its styling to the EPUB CCS. There are also useful addins for Word - EPUB Tools (it is in the MR Workshop forum), and Transtools, which has an excellent Unbreaker tool. BR |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create line breaks? | begtognen | Editor | 16 | 05-08-2025 09:49 PM |
Line breaks on Kindle, no line breaks on 4 PC | Siavahda | Kindle Formats | 0 | 10-20-2012 05:50 AM |
Adding page breaks in Calibre breaks ePubcheck validation | bookraft | Conversion | 16 | 03-01-2011 01:23 PM |
No line breaks | ecpepper | Amazon Kindle | 3 | 08-09-2009 06:42 PM |
Calibre PDF to LRF losing line breaks | kad032000 | Calibre | 11 | 06-23-2008 10:22 AM |