03-28-2010, 12:32 AM | #1 |
Wizard
Posts: 2,284
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Help w/margin problem following conversion
Forgive me if this has been answered before, but my searches here have produced zip.
I sanitized a Topaz file, converted to HTML, cleaned it up a bit with Sigil/WYSIWYG with hopes of converting to a decent mobi file. HTML looks good in Calibre's viewer, but after Calibre converts it the right margin has a normal width and the left margin is twice as wide. What is causing Calibre to do this in the conversion? Is there something that I can do with the HTML code (I'm almost clueless in this area) to prevent Calibre from producing a larger l/h margin? Thanks to anyone who can help... |
03-28-2010, 04:59 PM | #2 |
Wizard
Posts: 2,284
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Nobody?
|
Advert | |
|
03-28-2010, 09:15 PM | #3 |
本の虫
Posts: 242
Karma: 344
Join Date: May 2008
Location: USA
Device: Kindle3, DXG, Fire · iPad, iPod
|
I'd love to receive those thanks but I'm afraid I can't help. Similar kind of thing happened to me last week with a sanitized ePUB novel. Both the left and right margins were huge, the text column only about 50% of the screen. That was on my IREX DR800SG. Looked fine in Calibre though.
I tried simplifying the CSS, removing all but Calibre's margin settings, but no go. I ended up unzipping the ePUB, displaying the HTML files in Firefox one by one (all 24, one per chapter), copying the rich text to Atlantis WP, tidying up, then having Atlantis output the EPUB with bare bones formatting. Looked great. The original had something like five pages of CSS, a define for every little element. It was ridiculous. I'm not suggesting this fix to you, of course. |
03-29-2010, 01:04 AM | #4 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
|
|
03-29-2010, 01:41 AM | #5 |
Wizard
Posts: 2,284
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
|
Advert | |
|
03-29-2010, 02:21 AM | #6 |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Does the mobi file look OK in Calibre's viewer or does it only look messed up on your Kindle?
|
03-29-2010, 04:46 AM | #7 | ||
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
I reviewed the html you sent it was missing the style.css file and the images. These files are most likely in folders right next to your html.
Since the style.css file was missing, this is the file that contains your margins and all other style info for your doc. I went and found one in the epub you sent. I just had to unzip the epub file (renamed the .epub to .zip) you also sent and was able to view the .css file in it. All you have to do to make your conversion to mobi or epub a success is to modify the style.css (create a copy of the style.css before you muck with it so you can always return to the baseline) file and get rid of the screwy margins. This is done by opening the style.css file in a text editor, I use Notepad++ because it is good, opensource and free to use. Once you have the css file open in a text editor you'll see code to determine what everything in this html looks like. In this css file there is alot of code controlling paragraphs (p.) and headers (h1,h2,h3,h4) One line is prefaced p.cl-1p-v1 this identifies paragraph class=cl-1p-v1, this is the line that controls all paragraphs surrounded by that P tag. Below is one paragraph from your html. When I used my browser (Firefox) to view source for your html file I found most of the main paragraphs of text were identified by p.cl-1p-v1 as exampled below. Quote:
Code:
p.cl-1p-v1 { text-indent: 2.5%; margin-left: 0.0%; margin-top: 0.0%; text-align: justify; margin-right: 0.0%; line-height: 100.0%; } Quote:
Code:
p.cl-pf-v1 { text-indent: 2.5%; margin-left: 0.0%; margin-top: 0.0%; text-align: justify; margin-right: 0.0%; line-height: 100.0%; } There are other's that have a large left margin but you might want to leave them or change them as they are the critics blurbs in the beginning of the book. After you change the code and the html looks as expected then add it to Calibre and convert it. If you get lost use Google and look up css paragraph or css margins or better yet css tutorials for beginners for more info. A person who can wallow in the script world enough to change drm'd topaz books to a suitable format can handle basic css. Anyone who knows html and css can tell I am clueless but even I can make one of these things look like the other. Poke around, get your hands dirty, you'll be fine. I emailed you the epub back with only the 2 lines below changed in the style002.css file. View the epub and see if this corrected the worst of what you were talking about. Code:
p.cl-1p-v1 { text-indent: 2.5%; margin-left: 0.0%; margin-top: 0.0%; text-align: justify; margin-right: 0.0%; line-height: 100.0%; } p.cl-pf-v1 { text-indent: 2.5%; margin-left: 0.0%; margin-top: 0.0%; text-align: justify; margin-right: 0.0%; line-height: 100.0%; } Last edited by DoctorOhh; 03-29-2010 at 05:09 AM. |
||
03-29-2010, 01:43 PM | #8 |
Wizard
Posts: 2,284
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Walt,
(Re: your previous question: the margin problem was there with the mobi file viewed in Calibre) It looks great! Thank you very, very much for your effort and explanation - something even I am able to understand. Whatever code with which I was experimenting was apparently wrong and I will use your result as a study guide. Your recommendation of Notepad++ is appreciated - it may be a bit easier for me. Again, thank you very much for your time and assistance which will hopefully help clueless others as well. -Pat |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Margin Control with ePub/Mobi Conversion | ascherjim | Calibre | 7 | 10-15-2010 03:09 AM |
ibook on the iphone margin problem | gandor62 | Calibre | 0 | 10-08-2010 10:41 PM |
New conversion questions: Getting rid of huge left margin Epub to Mobi | geekgeek | Calibre | 2 | 08-31-2010 11:00 PM |
conversion problem? | mountainman80 | ePub | 8 | 01-29-2010 11:54 PM |
calibre ignore margin-top and margin-bottom | bender | Calibre | 2 | 12-11-2009 06:58 AM |