07-28-2010, 07:21 PM | #1 |
Junior Member
Posts: 8
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
[Old Thread] Convert epub to mobi with wide left margin on Kindle
Hello everybody,
I just got a kindle, and started to convert my epub to mobi to read on Kindle, but I found this common problem exactly the same as described here: http://bugs.calibre-ebook.com/ticket/1944 I converted my book and it looked fine on the computer viewer, but when I upload it to Kindle, it gets wide left margin which makes it looks weird. I'll attach the two files I have, the original epub and the mobi I converted. I can get kindle screenshots too if necessary. Thank A LOT!!!!! Victoria |
07-29-2010, 12:55 AM | #2 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
According to the ticket you cite the margins in the epub need to be cleaned up prior to conversion. Use Sigil to change the margins, save it and convert it again. Info on Sigil (epub editor) can be found in the Sigil forum. |
|
Advert | |
|
07-29-2010, 08:50 AM | #3 |
Junior Member
Posts: 8
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
Thank for your reply...yeah I noticed the magin-left:1em, I manually changed it to 0 in a webpage editor but it didn't do anything...
another thing I've noticed with my issue is if I convert the epub books that have HTML pages, it works just fine, but every epub I have that has XHTML pages have problem with left margin...could that have anything to do with it? |
07-29-2010, 10:27 AM | #4 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
Quote:
|
|
07-29-2010, 05:43 PM | #5 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
First at the top of each page you have the margin that calibre sets based on your device setting. @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } Then in the css file itself you have various classes where the margins are set at 5pt. Two primary <body class="calibre3"> <p class="calibre4"> each of these add another 5pt for a total margin of 15pt. Prior to conversion to mobi change every left and right margin in the css file to "0". This will leave just the @page margin (the one controlled by page setup under conversion settings) left for transfer. I may be off but start with all of them at 0 in the css file and see what effect that has. Last edited by DoctorOhh; 07-29-2010 at 05:45 PM. |
|
Advert | |
|
07-30-2010, 03:04 AM | #6 |
Junior Member
Posts: 6
Karma: 46
Join Date: Jul 2010
Device: kindle 2
|
I am having the same problem... any luck victoria???
|
07-30-2010, 08:23 AM | #7 |
Junior Member
Posts: 8
Karma: 10
Join Date: Jul 2010
Device: Kindle
|
Yeah, I kinda got it figured out. Dwanthny has the right direction to go with this...convert all the epub to epub in Calibre so you can use Sigil to edit the CSS style sheet. then look at all the <p> see which CSS class it is using, change all the margins to 0, and sometimes the <div> has something to do with it too...well if you don't want to bother with which is which, you can just simply change every left-margin and right-margin to 0...hope it works for you
|
07-30-2010, 01:09 PM | #8 |
Junior Member
Posts: 6
Karma: 46
Join Date: Jul 2010
Device: kindle 2
|
Yeah, perfect. Its a little bit of work, but that is soooooo much less annoying once that left margin is gone. Great results. Just have to play with it a little bit.
Thanks guys. |
07-30-2010, 09:37 PM | #9 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
My preferred format is epub and it is so much easier with the addition of Sigil. |
|
07-31-2010, 12:16 PM | #10 |
Groupie
Posts: 156
Karma: 354
Join Date: Mar 2009
Location: US
Device: iPad mini, iPad 2, Kindle 3
|
Every epub I've ever converted in Calibre has had this issue. What I've always done is unzip the epub, edit each and every xhtml file inside the epub individually to remove the entire stylesheet, and then rezip the files and rename to epub again. I also, while I'm at it, get rid of the extra <p></p> that, in every epub I've ever encountered, cause there to be an extra space between paragraphs that Calibre will not (or at least I've been unable to make it) delete.
Is there any possibility of creating within Calibre some sort of shortcut for solving this, rather than having to go through this laborious process every time? I can't figure out a way to create css to override the epub margins, or a way to delete the extra space between paragraphs - but since this seems, in my own experience at least, to be a universal problem with epub->mobi conversion (again, I have never *not* encountered this when doing such a conversion), perhaps Calibre might be able to accommodate it? |
07-31-2010, 09:57 PM | #11 |
Resident Curmudgeon
Posts: 75,860
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I did report the issue of the @page margins not bing fixed if I specify no margins in the conversion. I do think this needs to be fixed.
|
08-02-2010, 11:24 AM | #12 | |
Junior Member
Posts: 6
Karma: 46
Join Date: Jul 2010
Device: kindle 2
|
Quote:
http://bugs.calibre-ebook.com/ticket/6343 "calibre is designed TO PRESERVE THE FORMATTING OF THE INPUT FILE IN THE OUTPUT FILE. That means that if your input file specifies margins for elements then the OUTPUT FILE WILL ALSO HAVE THEM." |
|
08-02-2010, 11:37 AM | #13 |
Junior Member
Posts: 6
Karma: 46
Join Date: Jul 2010
Device: kindle 2
|
Fixing this problem for Dummies:
If anyone wanted to know the quick step by step I am doing to solve the problem I'll describe it below. -First go to Calibre and convert Epub to Epub (yes the same format), making sure to go to "Page Setup" and change the left margin to 0. -Then go into Sigil and open the new Epub file (it should automatically update or save in a new location). If it doesn't open or has an error it might be the old file you are opening, not the new one. -Go under the folder "Styles" under the Book Browser, and open the Stylesheet.css -In the style sheet, all I do is look for every single thing that says marginleft OR marginright and make sure the value is 0 for everything. If it says 1em I change it to 0em. If it says 5pt, I change it to 0pt. If its 0 I leave it at 0. If it says auto I leave it saying auto. -Control S (Command S for mac) to save. Then exit Sigil -Back in Calibre all I do is click convert to Mobi this time to make a Kindle compatible file format. Again make sure under "Page setup" it has 0 for the left margin value (it should if you did this before). -Now when you put the file on the device it should be in a nice normal format. Everytime i've followed this procedure it has worked very nicely. I DO wish that Calibre could do this by itself, as it takes like a minute per book conversion, but its not the worst thing in the world. Since I'm somewhat computer illiterate this HOWTO would have at least saved ME a ton of time figuring out how to fix this problem when I first had it. Last edited by dogbreath999; 08-02-2010 at 11:59 AM. |
08-02-2010, 09:46 PM | #14 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Good directions just click to open in the book details panel then open the epub in Sigil. It is interesting how often people seem to run into this. I have converted 2300+ books to epub and I have had maybe 1% of my books have margins set for the book. I have had another .5% that had weird margins for certain text of emphasis that I have had to adjust. Those 2300+ books I have converted come from a wide variety of legitimate and questionable sources. Bottom line is your advice will work fine if anyone runs into this problem. |
|
09-01-2010, 10:07 AM | #15 |
Member
Posts: 11
Karma: 106
Join Date: Aug 2010
Device: Kindle
|
As I had a lot of files to convert from EPUB to MOBI (and they were all giving me the left margin problem) I decided to write a small program to overwrite the stylesheet.css file with one of my own definition.
If anyone wants a copy let me know. Last edited by mvdarend; 09-09-2010 at 04:11 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't remove wide margin left side :( | allowingtoo | Sigil | 2 | 10-02-2011 01:57 PM |
.mobi conversion adding unwanted left margin | Skydog | Conversion | 3 | 05-01-2011 07:43 PM |
EPub>Mobi>Kindle 3 large left margins | Zenthor | Calibre | 14 | 11-02-2010 08:37 AM |
New conversion questions: Getting rid of huge left margin Epub to Mobi | geekgeek | Calibre | 2 | 08-31-2010 11:00 PM |
Wide left margins in epub to kindle conversion | jchrist | Calibre | 0 | 02-02-2010 09:13 PM |