![]() |
#1 |
Chasing Butterflies
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Calibre ePUB to mobi conversion help (with images)
I could use some help.
I'm trying to convert an ePUB book to a mobi book via Calibre 0.8.35. The conversion seems pretty good except I'm bumping up into a problem with the images. Images that should be on the same page as the following text are sometimes cordoned off on their own page and I don't want that. The weird thing is that this isn't occurring everywhere -- so I can see that I can get what I want, I just can't figure out how. Help! --- The Chapter1 picture (attached) is bad. You can see that the image is on a separate page from the text. The ePUB code (pre-conversion) is here: Code:
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Chapter 1 - Rosella</title> <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" /> <style type="text/css"> /*<![CDATA[*/ @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } p.sgc-1 {text-align: center;} /*]]>*/ </style> </head> <body style=""> <p class="sgc-1"><img alt="Chapter 1 - Rosella" src="../Images/Chapter%2001%20-%20Rosella.png" /></p> <h1 id="heading_id_2" title="Chapter 1 - Rosella">Chapter 1 - <i>Rosella</i></h1> <p class="text">Rosella eyed the darkening sky appreciatively as she walked the dirt-packed road. The sky had threatened rain all day, and she was thrilled to see thick thunderclouds rolling overhead as dusk approached. She hadn't planned on a downpour, and did not have the necessary skill with weather to create one even if she had, but a storm would add a nice touch to tonight's events.</p> Code:
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Rosella</title> <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" /> <style type="text/css"> /*<![CDATA[*/ @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } p.sgc-1 {text-align: center;} /*]]>*/ </style> </head> <body style=""> <p class="sgc-1"><img alt="Character Portrait: Rosella" src="../Images/Chapter%2001%20-%20Rosella.png" /></p> <h2 id="heading_id_2" title="Character Portrait: Rosella">Character Portrait: <i>Rosella</i></h2> <p class="text">When I started <i>Pulchritude</i>, the "Beauty and the Beast" story most firmly fixed in my mind was the Disney version, which starts with a curse. A beautiful fairy disguises herself as a beggar and then curses a prince for his selfishness when he refuses to give her lodging for the night.</p> |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
look at your stylesheet.
see if you have styles for h1 and h2 (note there is no leading dot as these apply at the Tag Level) Post those sections (guessing h1 has a page-break-before: always ) and you want that to happen before you image and page-break-before: never for the h2 tag |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Chasing Butterflies
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Thank you for responding.
![]() This is my stylesheet: Code:
@namespace h "http://www.w3.org/1999/xhtml"; body { margin: 0; } h1 { text-align: left; } h2 { text-align: left;} img {text-align: center;} |
![]() |
![]() |
![]() |
#4 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Note doing this at the Tag level affects all IMG tags and All H1 and H2 tags it might be better to create some classes and style the appropriate locations. KISS is not always appropriate ![]() |
|
![]() |
![]() |
![]() |
#5 |
Chasing Butterflies
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Unfortunately, that didn't change the behavior seen in conversion.
![]() I really am not against making it more complicated if it makes the conversion act as I need it to, but it sure would be nice to understand why the Character Portrait instance works fine but the Chapter 1 instance doesn't. That seems significant to me, somehow. ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Chasing Butterflies
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Well, by trial and error I have narrowed it down.
This works: Code:
<h1 id="heading_id_2" title="Chapter 1 - Rosella">Character Portrait: <i>Rosella</i></h1> Code:
<h1 id="heading_id_2" title="Chapter 1 - Rosella">Chapter 1: <i>Rosella</i></h1> It almost seems like the page is being split because of the word "Chapter". Can that be possible? Is there a way to prevent that? ![]() |
![]() |
![]() |
![]() |
#7 |
Chasing Butterflies
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Now I knew what to look for, I found a previous thread and solved it. Thank you!
![]() https://www.mobileread.com/forums/sho...d.php?t=101467 |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem with images - epub to mobi conversion | LynnGHughes | Kindle Formats | 18 | 04-17-2012 09:56 AM |
Calibre MOBI to EPUB conversion error | spanishgirl94 | Conversion | 3 | 03-19-2011 05:22 PM |
help mobi to epub conversion: lost all images | Sylver | Calibre | 10 | 01-13-2011 08:31 PM |
Automatic Web conversion to mobi/epub and send mail by Calibre | bthoven | Amazon Kindle | 0 | 11-14-2010 09:56 PM |
Conversion Error lrf -> mobi/epub (Calibre 0.6.33) | Joerg_Mosthaf | Calibre | 2 | 01-13-2010 07:40 AM |