Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-21-2008, 08:46 PM   #1
kad032000
Connoisseur
kad032000 doesn't litterkad032000 doesn't litter
 
Posts: 82
Karma: 184
Join Date: Jun 2008
Device: Sony PRS-505
Calibre PDF to LRF losing line breaks

I'm having trouble explaining this so here's an example:

Quote:
Let's say this is an example pdf file. This is the first paragraph.

This is the second paragraph.

And here's a third!
Sometimes the resulting lrf will look like

Quote:
Let's say this is an example pdf file. This is the first paragraph.
This is the second paragraph.
And here's a third!
(Which is what I want.) But other times it will look like

Quote:
Let's say this is an example pdf file. This is the first paragraph. This is the second paragraph. And here's a third!
Any ideas?
kad032000 is offline   Reply With Quote
Old 06-21-2008, 09:08 PM   #2
kad032000
Connoisseur
kad032000 doesn't litterkad032000 doesn't litter
 
Posts: 82
Karma: 184
Join Date: Jun 2008
Device: Sony PRS-505
FYI, by sometimes, I mean that there are some sections of a PDF where the first example will occur, and some where the second will occur, not that it will happen differently if I try it multiple times.
kad032000 is offline   Reply With Quote
Old 06-21-2008, 09:25 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,908
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
that's because the PDF reflow engine tries to guess which line endings are "hard" and which are not. It doesn't always succeed.
kovidgoyal is offline   Reply With Quote
Old 06-22-2008, 11:05 AM   #4
rhadin
Literacy = Understanding
rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.
 
rhadin's Avatar
 
Posts: 3,162
Karma: 15394122
Join Date: Dec 2007
Location: The World of Books
Device: Sony PRS-950, Nook Tablet
Kovid,

I've also noted that when Calibre adds a book to the library, it chops off the first letter in the filename. For example, if the book filename is

The Three Musketeers.lrf

and I ask Calibre to add it to the library, it adds

he Three Musketeers.lrf

I have found the easiest way to reslove the problem is to rename the file by adding a leading x (e.g., xThe Three Musketeers.lrf) before adding it to the Calibre library.
rhadin is offline   Reply With Quote
Old 06-22-2008, 05:19 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,908
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
this is when adding LRF files or any kind of file?
kovidgoyal is offline   Reply With Quote
Old 06-22-2008, 05:26 PM   #6
pilotbob
Grand Sorcerer
pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.
 
pilotbob's Avatar
 
Posts: 19,555
Karma: 11337367
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by kovidgoyal View Post
this is when adding LRF files or any kind of file?
I've noticed this too. Has happened with the last few TOR .prc books that I have added to the db. Or maybe it has happened with all of them.

BOb
pilotbob is offline   Reply With Quote
Old 06-22-2008, 06:21 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,908
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
there was a bug in the PRC metadata reading code which should now be fixed in 0.4.73
kovidgoyal is offline   Reply With Quote
Old 06-22-2008, 06:34 PM   #8
rhadin
Literacy = Understanding
rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.
 
rhadin's Avatar
 
Posts: 3,162
Karma: 15394122
Join Date: Dec 2007
Location: The World of Books
Device: Sony PRS-950, Nook Tablet
Quote:
Originally Posted by kovidgoyal View Post
this is when adding LRF files or any kind of file?
Like Bob, I noticed it with the Tor .prc files. But I also noticed it with Baen .lrf files and with .lrf files I have downloaded from MobileRead.
rhadin is offline   Reply With Quote
Old 06-22-2008, 07:09 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,908
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Can you post a link to a mobileread lrf that causes this to happen, I just tested with some random LRFs and it works for me.
kovidgoyal is offline   Reply With Quote
Old 06-22-2008, 08:26 PM   #10
kad032000
Connoisseur
kad032000 doesn't litterkad032000 doesn't litter
 
Posts: 82
Karma: 184
Join Date: Jun 2008
Device: Sony PRS-505
FYI,

For the books I'm currently using, I've found that if I convert to html, the line breaks for new paragraphs occur immediately after the last character of the paragraph whereas the line breaks between two lines of text in the same paragraph have a space before the break. Thus you can do a simple replace all in a text editor of " <br>" to "".

Which makes sense from a typing perspective. When typing, you don't press enter at the end of a normal line (the editor automatically moves you there), so there's always a space before the next word. And when you want to create a new line, you don't insert a space then press enter, you just press enter. At least, that's what I do...
kad032000 is offline   Reply With Quote
Old 06-22-2008, 09:07 PM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,908
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
An interesting observation. But I doubt it would be much more reliable than the current heuristics over the set of all PDF files. I do have a complete rewrite of the PDF reflow engine in my queue, so I'll keep this in mind when I get to it.
kovidgoyal is offline   Reply With Quote
Old 06-23-2008, 10:22 AM   #12
rhadin
Literacy = Understanding
rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.
 
rhadin's Avatar
 
Posts: 3,162
Karma: 15394122
Join Date: Dec 2007
Location: The World of Books
Device: Sony PRS-950, Nook Tablet
Quote:
Originally Posted by kovidgoyal View Post
Can you post a link to a mobileread lrf that causes this to happen, I just tested with some random LRFs and it works for me.
Kovid, the next time it occurs I will send you a link. It occurred with version .72 but since I upgraded to version .73, it hasn't occurred on the one file I downloaded from MobileRead.
rhadin is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
losing line spacing when converting with Calibre Stensie4JC Conversion 9 01-23-2011 03:47 PM
Kindle 3 PDF Conversion Line Breaks mvnjpy Calibre 3 09-26-2010 09:36 PM
Converting from LRF: Paragraph & Line Breaks wudaben LRF 0 07-14-2010 11:32 PM
Ignoring line breaks in pdf file mike_bike_kite Calibre 0 06-14-2010 09:37 AM
convert to lrf : paragraph indents, line breaks karo02 Calibre 4 01-27-2009 09:19 AM


All times are GMT -4. The time now is 11:32 AM.


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