Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-30-2011, 05:31 AM   #1
David J. Perry
Junior Member
David J. Perry began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Kindle 4
Question Defining the 'start point' in HTML and using Calibre to generate the .mobi

Hi all,

I guess this is probably a simple question, but let me preface it by saying I'm completely HTML savvy, and my preference for building books is to manually build the HTML file, and then import this into Calibre.

When my Kindle opens my book, it opens it at the 'first page' - that is, the title page. If I then press the 'page forward' button on my Kindle, I go through pages (copyright, dedication, etc) until I get to page one of my novel.

On other books on my Kindle, when I 'open' the book, it goes straight to 'page one' of the novel. I could, of course, achieve this by moving my front matter to the back, but, critically, when I press the 'page back' button on these books on my Kindle, I go BACK through the dedication, copyright, title page, and then cover - that is, everything is in the 'right' place, but the Kindle opens it at first page of the story.

How can I achieve this in the HTML? So far I've tried <a name="start"> and <div id="start">, but no joy as yet...

Thanks for your time
David J. Perry is offline   Reply With Quote
Old 12-30-2011, 05:50 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
It's not done in HTML. This type of thing is done in the "Guide" section of the OPF file.

I don't know how you'd do it in Calibre (or even if it can be done in Calibre); the normal way to do it would be to use Mobipocket Creator (which is basically a GUI interface for an OPF file editor).
HarryT is offline   Reply With Quote
Advert
Old 12-30-2011, 05:52 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can't acheive this in HTML, you have to create an OPF file, and add a guide section to it that points to the place you want the start to go. The easisest way to do that is to convert to EPUB, use the Tweak EPUB feature to edit the OPF and insert the reference there, then convert the EPUB to MOBI.
kovidgoyal is offline   Reply With Quote
Old 12-30-2011, 06:00 AM   #4
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
Another alternative to do the same thing is to use Sigil, which will also allow you to preserve your html (just disable tidying) - making it far easier to make changes as well as keeping your files in one place and providing a pretty solid set of features.

Just 'add existing' and select all of your html, it will pull in the rest of the referenced files and then save out as an epub. You can then leave this epub inside Calibre's library and edit as needed, doing the conversion to mobi when you want to proof on device.
Serpentine is offline   Reply With Quote
Old 12-30-2011, 07:39 AM   #5
David J. Perry
Junior Member
David J. Perry began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Kindle 4
The problem is, the conversion from ePub to Mobi ruins the rest of the formatting - it's a screenplay, and therefore the formatting is very delicate, and depends on margins being set as a paragraph style which ePub seems incapable of handling..?

There presumably must be a way to edit the OPF file without it getting anywhere near an ePub?
David J. Perry is offline   Reply With Quote
Advert
Old 12-30-2011, 07:55 AM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Did you not read my post #2, David? Have you tried using Mobipocket Creator?
HarryT is offline   Reply With Quote
Old 12-30-2011, 08:00 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can create an OPF by hand and put it in a zip file alongwith the html, then calibre will use it.
kovidgoyal is offline   Reply With Quote
Old 12-30-2011, 09:25 AM   #8
David J. Perry
Junior Member
David J. Perry began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Kindle 4
Sorry Harry - I didn't make it clear (or, indeed, thank you for your help - thank you). I did indeed try the mobipocket creator, and was entirely hopeful. Mobipocket does indeed cause it to open at the right page, but destroys the rest of the screenplay formatting in the process.

I have also tried to manually hard-code everything through Kindlegen, and have, perhaps understandably, ended up with identical results.

The only thing that preserves the screenplay margins and formatting I want is to get Calibre to convert the html file to mobi. I'm not sure why that is? But it works... I'll try to include the opf in a zip next, but I have a feeling this one is going to beat me...
David J. Perry is offline   Reply With Quote
Old 12-30-2011, 09:37 AM   #9
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
Quote:
Originally Posted by David J. Perry View Post
... depends on margins being set as a paragraph style which ePub seems incapable of handling..?
I'm not too sure what you mean by this.

Epub should be able to deal with margins in more ways than the mobi (at least on Kindle), after all epub is just html and things like the opf to define standard structure, all collected in a zip archive. The html that you're currently using would be preserved, which should mean that the conversion would be just the same as what you are expecting.

Perhaps it would help if you could give an example of one of your html files (feel free to replace the content with random words).
Serpentine is offline   Reply With Quote
Old 12-30-2011, 10:10 AM   #10
David J. Perry
Junior Member
David J. Perry began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Kindle 4
That's a brilliant idea, if no one minds..?

Please find attached two files - one, the source HTML (in which there are two key things - one is the indenting/margins issue, and the other is the 'all upper case' scene titles and character names) and the other, the mobi file produced perfectly by conversion to mobi by Calibre.

However else I convert the file, I gain in the 'start point' issue, but lose the margins/all upper case. Any help would be very gratefully received.

Thanks all.
Attached Files
File Type: zip Tempus screenplay for forum.zip (145.8 KB, 158 views)
David J. Perry is offline   Reply With Quote
Old 12-30-2011, 10:12 AM   #11
David J. Perry
Junior Member
David J. Perry began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Kindle 4
Sorry - in addition, I've had no joy manually inserting the OPF file - this fails on the conversion, though this may well be 'pilot error' - it complained about something missing from the spine section, though I couldn't work out what it was...
David J. Perry is offline   Reply With Quote
Old 12-31-2011, 01:55 PM   #12
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
Hmmm, the conversion with working indents is the result of them being replaced with nested blockquotes. This is not very elegant to work with, and looks really messy, however it's a Kindle issue :/

Other methods—that I remember—are to use tables, which is also hacky and a bad idea. Or pre's which run into issues with page turns.
Serpentine is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easiest way to start creating .mobi from HTML using C#? jonj Kindle Formats 9 12-10-2011 11:30 AM
Calibre does not convert HTML to MOBI completely perchiper Conversion 1 09-03-2011 10:10 AM
problems converting html to mobi with calibre tekjonston Conversion 3 04-18-2011 01:08 AM
can't generate a toc from an html file p3aul Calibre 13 08-27-2010 05:44 AM
Still can't generate a Mobi catalog Sydney's Mom Library Management 11 02-02-2010 08:55 AM


All times are GMT -4. The time now is 01:39 PM.


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