10-08-2013, 08:01 AM | #586 | |
Grand Sorcerer
Posts: 27,465
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I don't know about calibre, but once you make the changes to your html file and your opf file, you should then convert the opf file with kindlegen/previewer. What you've described is what happens when you try to convert the html file (which knows nothing about the opf file). All files must remain in their relative position to each other in the directory structure when feeding the opf file to kindlegen, too.
Quote:
Also, when using kindlegen, you need to make sure you're viewing the mobi part of the conversion and not the KF8 part (which will also look exactly as you described if you fed the converter mobi-only source code). You can also use KindleUnpack to split the mobi-only portion of the resulting file from the KF8 portion. The bottom-line is (and I know this is probably confusing): mobi-only source (html) is not suitable for building KF8 kindlebooks. |
|
10-08-2013, 09:49 AM | #587 |
The Grand Mouse 高貴的老鼠
Posts: 71,410
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
I recommend working from an ePub and KindleGen, rather than converting through calibre. But it you really want to use calibre, convert to a .azw3 rather than a .mobi.
|
Advert | |
|
10-08-2013, 03:01 PM | #588 | |
Bookmaker & Cat Slave
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
10-08-2013, 03:31 PM | #589 |
The Grand Mouse 高貴的老鼠
Posts: 71,410
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
|
10-08-2013, 03:33 PM | #590 | ||||
Member
Posts: 11
Karma: 288770
Join Date: Jun 2012
Device: none
|
Quote:
This is the process I'm using (I'm testing with the Android Kindle app on a Nexus 10). First Calibre to convert from DOCX to MOBI: Code:
ebook-convert "First Contact.docx" "FirstContact.mobi" --mobi-keep-original-images --no-inline-toc --disable-font-rescaling This works great. It's the only way (so far) I have found that reliably preserves top-margins (for things like pages with Chapter headings). The paragraphs are indented correctly, and there are no gaps between them. The only problem is the lack of an active TOC link in the Kindle Goto menu. Note: it is generating, the old, Mobi version 6 (7?), format. Next, KindleUnpack. I'm using the latest pyw file downloaded from the link in the first comment on this thread. I don't turn on any of the options, and it extracts (generates) the HTML, OPF, and NCX files, along with the single image I use, all in a mobi7 directory. Finally, if I don't touch those three files at all, and use "KindleGen FirstContact.opf" and test the resulting mobi file, the top margins that appeared in the Calibre generated mobi file are gone, as are the paragraph indents, and the paragraphs now have what looks like the default HTML spacing between them. NOTE: Some empty lines I use for padding in the front matter are gone too (at the top of pages only). It looks as though the HEIGHT attribute used to do this vertical spacing at the top of pages is no longer being honored at all. Quote:
Quote:
Quote:
It's as though the Kindle app is no longer recognizing the unpacked/repacked mobi file as the same type of format. Could that be happening? Is KindleGen doing something that's changing some internal setting on the MOBI file? I'll keep fiddling, but it looks as though my current route is stymied unless I can understand why my formatting vanishes even though I seem to be following the correct process to the letter. I may take a look at the conversion source code to see if I can hack the TOC recognition into that. Alternatively, I could give up on my formatting of the TOC (it's a list of short story titles, so I've centered them on the page) and conform it to what Calibre expects. Thanks again for your timely reply. Last edited by tacitus; 10-08-2013 at 03:38 PM. |
||||
Advert | |
|
10-08-2013, 03:37 PM | #591 | |
The Grand Mouse 高貴的老鼠
Posts: 71,410
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
|
|
10-08-2013, 04:15 PM | #592 |
Grand Sorcerer
Posts: 27,465
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
What pdurrant said.
When you're converting the opf with kindlegen and then viewing with a Kindle app, I think you're seeing the KF8 portion of the file--which will look very wonky and unformatted if built from mobi-only source. I think this because you just can't build a mobi-only book with kindlegen/Previewer. It always builds a combination MOBI/KF8 file. And if the Kindle App supports KF8, that's what it's going to show you. I suggest this: 1) Take the calibre mobi (converted from docx) and extract the mobi-only contents like you have been doing. 2) Make your edits to the html and opf and then convert with kindlegen (using the opf file). 3) Take the resulting kindlebook (which is at this point a combination MOBI/KF8 file) and use KindleUnpack to split that file into its component .mobi and .azw3 files (check the "Split Combination KF8 Kindle eBooks" box ). 4) Load the .mobi file produced from step 3 into your Kindle app or the Kindle Previewer I just checked and all paragraph indents, top margins an other original formatting were retained in this manner. You could also go from DOCX to ePub (or DOCX to MOBI to ePub if something about the DOCX to MOBI conversion achieves a special need) with calibre, then edit the epub with Sigil and convert it back to mobi. |
10-08-2013, 05:10 PM | #593 | |
Bookmaker & Cat Slave
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
hitch |
|
10-08-2013, 05:30 PM | #594 |
The Grand Mouse 高貴的老鼠
Posts: 71,410
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
He's converting a docx to a mobi in calibre. It'll all be in one file, since plain mobi doesn't have multiple files.
|
10-08-2013, 06:32 PM | #595 |
Member
Posts: 11
Karma: 288770
Join Date: Jun 2012
Device: none
|
Thank you very much for your help DiapDealer and pdurrant. I'm now getting my formatting and the links to my TOC from the Goto menu. Thanks also for the development and maintenance of the unpack tools. They've come in very handy.
I still get the feeling that I'm just close to getting the direct Calibre conversion working too -- the converter sees that I have the TOC (there is a message that shows it's going through the right code path), but doesn't generate the necessary metadata to enable the Goto links. Other quirks have also appeared -- the starting point of the book has changed to after the front matter instead of being the title page (I think I know how to fix that), and all my transparent gifs now have a black background on Kindle devices. I believe that's something to do with the native resolution of the images -- which should be fixable -- but it only shows up when I put the Calibre created mobi through the unpack/kindlegen/unpack process. (Edit: Well, that was not true -- I forgot I made the GIF background transparent while I was testing on my tablet. That works fine, but I had since learned that transparent GIFs are not well supported on eInk Kindle devices. I got them to work, but they look nasty.) I knew the book creation process was quirky, but I didn't quite appreciate just how quirky it is when you're dealing with the confluence of quirks involving Word, Calibre, KindleGen, and the Kindle devices! Last edited by tacitus; 10-08-2013 at 11:36 PM. |
10-08-2013, 06:38 PM | #596 | |
Member
Posts: 11
Karma: 288770
Join Date: Jun 2012
Device: none
|
Quote:
I had all but given up on using top-margins until I tried the latest DOCX calibre converter. It's a quirky workaround to the lack of real top-margin support, but seems to work well with the devices I have tested it on. It also preserves empty paragraphs (blank lines in Word) which gives you a lazy (and probably not recommended) way to pad out the front matter pages, like the dedication and quotation pages. |
|
10-08-2013, 06:54 PM | #597 | |
Bookmaker & Cat Slave
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
The problem with "real top-margin support" is simply that: top-margin from what, exactly, when you have one big file? The lack of top-margin support for mobi (of all kinds) when working in a single file is legendary. I'm not sure I even remember what we used to do to fake top-margins, sans separate files. Diap, do you remember? Or you, Great Mouse? And won't K8 ignore those empty paras? If not given some type of element, even an nbsp? Hitch |
|
10-08-2013, 10:04 PM | #598 | ||
Member
Posts: 11
Karma: 288770
Join Date: Jun 2012
Device: none
|
Quote:
(Does Amazon keep stats on the number of old-format-only devices out there, in the same way Google tracks the different versions of Android?) Quote:
Code:
<p height="0pt" width="0pt" align="center"> <font size="2">*</font> </p> I assume if you specify KF8 instead, it will generate something different, but I suspect they will try to preserve the spacing in some way. They did a passable job of faking small caps for mobi7 (not good enough for me to want to use, but still...) by capitalizing the text and setting the appropriate font sizes. |
||
10-09-2013, 02:47 AM | #599 |
Member
Posts: 11
Karma: 288770
Join Date: Jun 2012
Device: none
|
Well, the book is posted (not yet available, so no link!). Thanks again to everyone who took the time to reply to my queries. In the end, I just forgot about the GIFs and replaced them with JPEGs. The rest of the formatting looks great (well, it's what I wanted anyway ), and the TOC now works on both Kindle devices and Android tablets. I have to assume the other device categories are likely to work too.
Calibre's TOC processing actually did work for my eReader, but I needed to make that edit to the OPF and HTML to get Android Kindle to enable the Contents page. Next up -- ePub (well, in a few days, maybe). |
10-09-2013, 07:50 AM | #600 |
Grand Sorcerer
Posts: 27,465
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can i rotate text and insert images in Mobi and EPUB? | JanGLi | Kindle Formats | 5 | 02-02-2013 04:16 PM |
PDF to Mobi with text and images | pocketsprocket | Kindle Formats | 7 | 05-21-2012 07:06 AM |
Mobi files - images | DWC | Introduce Yourself | 5 | 07-06-2011 01:43 AM |
pdf to mobi... creating images rather than text | Dumhed | Calibre | 5 | 11-06-2010 12:08 PM |
Transfer of images on text files | anirudh215 | 2 | 06-22-2009 09:28 AM |