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 01-08-2009, 11:28 AM   #1
Alfy
Liseur de Bonne Aventure
Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.
 
Alfy's Avatar
 
Posts: 369
Karma: 2176666
Join Date: Sep 2008
Location: Paris, France
Device: PRS T1
Text becomes center-aligned when converting

Hi!

I'm trying to convert a html document with Calibre. When I open the html, whether it's in a browser, in Word or in Dreamweaver, the text is left-aligned, but when Calibre converts it, the text is center aligned.

I was wondering, is there any way I can control this from the gui or the command line?

Cheers,

Alfy.
Alfy is offline   Reply With Quote
Old 01-08-2009, 11:49 AM   #2
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 622
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Alfy View Post
I'm trying to convert a html document with Calibre. When I open the html, whether it's in a browser, in Word or in Dreamweaver, the text is left-aligned, but when Calibre converts it, the text is center aligned.
If you're converting it to LRF it's probably a problem with the LRF converter's CSS-groking. If you try EPUB output instead it'll probably work.
llasram is offline   Reply With Quote
Old 01-08-2009, 02:33 PM   #3
Alfy
Liseur de Bonne Aventure
Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.
 
Alfy's Avatar
 
Posts: 369
Karma: 2176666
Join Date: Sep 2008
Location: Paris, France
Device: PRS T1
Ah; but then I'd be stuck with ePub, yes?

Tried it out, and it worked, though. Thanks for the tip.

Is there anyway I can edit the original html to get it to convert properly into LRF? Ichecked the doc in Dreamweaver and it has no CSS. Should I create a new one to ensure it aligns left?
Alfy is offline   Reply With Quote
Old 01-08-2009, 02:46 PM   #4
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,352
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
try converting the EPUB to LRF (the conversion to EPUB may have rectified the problem with the original HTML)
kovidgoyal is online now   Reply With Quote
Old 01-08-2009, 02:57 PM   #5
Alfy
Liseur de Bonne Aventure
Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.Alfy ought to be getting tired of karma fortunes by now.
 
Alfy's Avatar
 
Posts: 369
Karma: 2176666
Join Date: Sep 2008
Location: Paris, France
Device: PRS T1
No touchdown this time, it's still center-aligned. I'll try to play around with the CSS tomorrow. Thanks for the help.
Alfy is offline   Reply With Quote
Old 01-08-2009, 03:23 PM   #6
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,352
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC this happens when some paragraph is styled as center aligned and then the remaining text is put after that paragraph without any <p> tags of its own. In that case html2lrf assumes that the style for the subsequent text should be the same as for the previous paragraph.

Last edited by kovidgoyal; 01-08-2009 at 09:24 PM.
kovidgoyal is online now   Reply With Quote
Old 01-08-2009, 09:20 PM   #7
Seabound
Steerage Class
Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.
 
Seabound's Avatar
 
Posts: 711
Karma: 505995
Join Date: Mar 2008
Location: Pacific Northwest, USA
Device: Won't fit here anymore, see sig for a list of liseuses.
Alfy, can you attach a sample code?
Seabound is offline   Reply With Quote
Old 01-08-2009, 10:58 PM   #8
mbagsh55
Enthusiast
mbagsh55 doesn't littermbagsh55 doesn't litter
 
Posts: 46
Karma: 196
Join Date: Nov 2007
Location: Kanagawa, Japan
Device: Sony PRS-700/Zaurus SL-3100
Quote:
Originally Posted by kovidgoyal View Post
IIRC this happens when some paragraph is styled as center aligned and then the remaining text is put after that paragraph without any <p> tags of its own. In that case html2lrf assumes that the style for the subsequent text should be the same as for the previous paragraph.
This is exactly what I have seen with some eReader output converted to HTML. The center aligned tag is followed by a paragraph and then my multiple ugly <br> tags rather than <p> tags with effectively one <P> tag per chapter.

My fix was to correct the HTML with search and replace, but in secondary books I just removed the center align tags.

Regards,
Marcus
mbagsh55 is offline   Reply With Quote
Old 01-08-2009, 11:40 PM   #9
Seabound
Steerage Class
Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.
 
Seabound's Avatar
 
Posts: 711
Karma: 505995
Join Date: Mar 2008
Location: Pacific Northwest, USA
Device: Won't fit here anymore, see sig for a list of liseuses.
Quote:
Originally Posted by mbagsh55 View Post
This is exactly what I have seen with some eReader output converted to HTML. The center aligned tag is followed by a paragraph and then my multiple ugly <br> tags rather than <p> tags with effectively one <P> tag per chapter.

My fix was to correct the HTML with search and replace, but in secondary books I just removed the center align tags.

Regards,
Marcus
I just looked at one html file converted from ereader, and I see what you mean. Ayayayayay. The file needs serious reformatting. Needless to say, this isn't calibre's problem.
Seabound is offline   Reply With Quote
Old 01-09-2009, 08:33 AM   #10
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 622
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Seabound View Post
I just looked at one html file converted from ereader, and I see what you mean. Ayayayayay. The file needs serious reformatting. Needless to say, this isn't calibre's problem.
That isn't the eReader book's fault per-se. In eReader PML, paragraphs are delimited by just two newlines, like in Project Gutenberg plain text. The ereader2html tool just translates those newlines into <br/> tags, leaving you with what you see.
llasram is offline   Reply With Quote
Old 01-09-2009, 10:37 PM   #11
Seabound
Steerage Class
Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.Seabound ought to be getting tired of karma fortunes by now.
 
Seabound's Avatar
 
Posts: 711
Karma: 505995
Join Date: Mar 2008
Location: Pacific Northwest, USA
Device: Won't fit here anymore, see sig for a list of liseuses.
Quote:
Originally Posted by llasram View Post
That isn't the eReader book's fault per-se. In eReader PML, paragraphs are delimited by just two newlines, like in Project Gutenberg plain text. The ereader2html tool just translates those newlines into <br/> tags, leaving you with what you see.
I didn't mean to say it was the eReader format's "fault". I had studied the PML format and the conversion script before I made the post and figured out what was going on. The conversion script can be enhanced so that the output html is formatted well.
Seabound is offline   Reply With Quote
Old 01-09-2009, 10:51 PM   #12
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 622
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Seabound View Post
I didn't mean to say it was the eReader format's "fault". I had studied the PML format and the conversion script before I made the post and figured out what was going on. The conversion script can be enhanced so that the output html is formatted well.
Ah, fair enough then.
llasram is offline   Reply With Quote
Old 01-19-2009, 12:41 AM   #13
mbagsh55
Enthusiast
mbagsh55 doesn't littermbagsh55 doesn't litter
 
Posts: 46
Karma: 196
Join Date: Nov 2007
Location: Kanagawa, Japan
Device: Sony PRS-700/Zaurus SL-3100
Quote:
Originally Posted by Seabound View Post
The conversion script can be enhanced so that the output html is formatted well.
Does it mean you have already done the hardwork and can share a modification to ereader2html that improves the HTML output?
mbagsh55 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
Centered and right aligned text for Stanza on iPhone Arjen ePub 6 06-17-2010 12:19 PM
Converting certain punctuations from text to epub greenapple Calibre 2 05-28-2010 08:27 PM
Converting OCR Text files jedavis1 Workshop 10 10-01-2009 10:09 PM
Converting non-ascii/non-unicode text - pictures the way to go? politicorific Workshop 5 04-02-2009 05:59 AM
Converting text to PDF with a2ps chrylis iRex 7 11-23-2007 11:46 AM


All times are GMT -4. The time now is 12:05 PM.


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