Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 02-19-2012, 08:22 PM   #1
anamardoll
Chasing Butterflies
anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.
 
anamardoll's Avatar
 
Posts: 3,131
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>
The CharacterPortrait picture (attached) is good. You can see that the image is on the same page as 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>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>
The major difference I can see is that one has an H1 tag and the other an H2 tag, but changing that didn't make a difference to the conversion. Any help is greatly appreciated.
Attached Thumbnails
Click image for larger version

Name:	chapter1.png
Views:	115
Size:	304.6 KB
ID:	82774   Click image for larger version

Name:	characterportrait.png
Views:	108
Size:	291.2 KB
ID:	82775  
anamardoll is offline   Reply With Quote
Old 02-19-2012, 11:14 PM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 15,268
Karma: 6020309
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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
theducks is offline   Reply With Quote
Old 02-19-2012, 11:16 PM   #3
anamardoll
Chasing Butterflies
anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.
 
anamardoll's Avatar
 
Posts: 3,131
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;}
I already tried changing the H1 to an H2 before conversion, just to test -- I got the same result. It's so weird.
anamardoll is offline   Reply With Quote
Old 02-19-2012, 11:27 PM   #4
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 15,268
Karma: 6020309
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by anamardoll View Post
Thank you for responding.

This is my stylesheet:

Code:
@namespace h "http://www.w3.org/1999/xhtml";
body { margin: 0; }
h1 { text-align: left; page-break-before: never;}
h2 { text-align: left;page-break-before: never;}
img {text-align: center;page-break-before: always;}
I already tried changing the H1 to an H2 before conversion, just to test -- I got the same result. It's so weird.
try adding the green
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
theducks is offline   Reply With Quote
Old 02-19-2012, 11:32 PM   #5
anamardoll
Chasing Butterflies
anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.
 
anamardoll's Avatar
 
Posts: 3,131
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.
anamardoll is offline   Reply With Quote
Old 02-19-2012, 11:45 PM   #6
anamardoll
Chasing Butterflies
anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.
 
anamardoll's Avatar
 
Posts: 3,131
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>
This doesn't:

Code:
<h1 id="heading_id_2" title="Chapter 1 - Rosella">Chapter 1: <i>Rosella</i></h1>
The ONLY difference between those two lines is the actual text: Character Portrait: Rosella and Chapter 1: Rosella.

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?
anamardoll is offline   Reply With Quote
Old 02-19-2012, 11:53 PM   #7
anamardoll
Chasing Butterflies
anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.anamardoll ought to be getting tired of karma fortunes by now.
 
anamardoll's Avatar
 
Posts: 3,131
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!

http://www.mobileread.com/forums/sho...d.php?t=101467
anamardoll 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
problem with images - epub to mobi conversion LynnGHughes Kindle Formats 18 04-17-2012 10:56 AM
Calibre MOBI to EPUB conversion error spanishgirl94 Conversion 3 03-19-2011 06:22 PM
help mobi to epub conversion: lost all images Sylver Calibre 10 01-13-2011 09:31 PM
Automatic Web conversion to mobi/epub and send mail by Calibre bthoven Amazon Kindle 0 11-14-2010 10:56 PM
Conversion Error lrf -> mobi/epub (Calibre 0.6.33) Joerg_Mosthaf Calibre 2 01-13-2010 08:40 AM


All times are GMT -4. The time now is 02:51 AM.


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