![]() |
#1 |
Liseur de Bonne Aventure
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 374
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. |
![]() |
![]() |
![]() |
#2 |
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Liseur de Bonne Aventure
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 374
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? |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,146
Karma: 27110894
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)
|
![]() |
![]() |
![]() |
#5 |
Liseur de Bonne Aventure
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 374
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,146
Karma: 27110894
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. |
![]() |
![]() |
![]() |
#7 |
Steerage Class
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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?
|
![]() |
![]() |
![]() |
#8 | |
Enthusiast
![]() ![]() Posts: 46
Karma: 196
Join Date: Nov 2007
Location: Kanagawa, Japan
Device: Sony PRS-700/Zaurus SL-3100
|
Quote:
My fix was to correct the HTML with search and replace, but in secondary books I just removed the center align tags. Regards, Marcus |
|
![]() |
![]() |
![]() |
#9 | |
Steerage Class
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#10 |
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
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.
|
![]() |
![]() |
![]() |
#11 |
Steerage Class
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
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.
|
![]() |
![]() |
![]() |
#12 | |
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#13 |
Enthusiast
![]() ![]() Posts: 46
Karma: 196
Join Date: Nov 2007
Location: Kanagawa, Japan
Device: Sony PRS-700/Zaurus SL-3100
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |