View Full Version : MobiPerl: LIT2MOBI page breaks don't work


=X=
11-11-2008, 05:55 PM
Well the title says it all.

I've noticed when I convert LIT files to MOBI files the page breaks are not preserved. I am I doing something wrong or is this a know issue.

=X=

tompe
11-11-2008, 05:57 PM
Well the title says it all.

I've noticed when I convert LIT files to MOBI files the page breaks are not preserved. I am I doing something wrong or is this a know issue.


I did not know that lit files had page breaks. Are they preserved in the exploded html code and how are they coded in the html code in that case?

=X=
11-11-2008, 06:46 PM
I did not know that lit files had page breaks. Are they preserved in the exploded html code and how are they coded in the html code in that case?

:blink: hey! Your not suppose to ask me the hard questions. I'm just suppose to wine and complain.


Just kidding.

I've looked at several different LIT files they all seem to use the following style sheet syntax.


page-break-before: always;
page-break-after: always;

This is full HTML so I've seen this tag placed in style sheets or have used the style sheet embedded command

<div style="page-break-before:always">
or like
DIV {font-size: medium;
page-break-before: always;}

or like

////////// HTML CODE //////////////////
<p class="pb">*</p>

// CSS CODE

.pb {
page-break-before: always;
}


I've uploaded a small LIT example created with WordRMR. And MOBI file created from LIT2MOBI.

Please ignore the highly technical content in the LIT/MOBI files the text is only for display purposes ;)

Snowman
11-11-2008, 09:06 PM
Interesting. If you decompile the .prc with mobi2oeb, then recompile with mobigen or creator without making any changes (apart from adding language and genre - I used 'horror' - to the opf), it works perfectly.

=X=
11-12-2008, 02:32 PM
Hey thanks for the tip. I used the decompiled OPF of the LIT and it produced a well formatted MOBI file.

=X=

pdurrant
11-13-2008, 07:34 AM
Mobipocket Creator certainly changes the HTML when creating the .mobi file. One thing I've found is that it does handle (some) CSS styles, including converting page-break-before:always into its own page break code.


Interesting. If you decompile the .prc with mobi2oeb, then recompile with mobigen or creator without making any changes (apart from adding language and genre - I used 'horror' - to the opf), it works perfectly.

Snowman
11-13-2008, 10:55 AM
And creator/mobigen is *very* idiosyncratic (read "brain-damaged") over what it will and won't silently ignore. For example:

<br style="page-break-after: always;" /> good
<br style="page-break-after: always;"> bad

compare with

<mbp;pagebreak /> good
<mbp;pagebreak> also good.
(colon ':' replaced with semi-colon ';' to prevent smiley).

Also of note - and annoyance - is style 'margin-top'. This implies that 'margin-bottom' is also supported. It is, sorta. What actually happens is that the attribute is actually added to the margin-top of the *next* block element IF that element supports it. If it doesn't, then the margin-bottom is lost. In reality, margin-top is implemented as the obsolescent "height".

And let us not even think about what mobi does to <h1> to <h6>.

I could go on. And on.

ARRRRRRGGGGGGHHHHH !!

Snowman then confesses that mobi format is what he uses for desktop, phone, and cybook. Although he does store the initially extracted oeb as the primary source.

tompe
11-13-2008, 11:08 AM
Style sheet support is bad in MobiPerl. I added a ticket for this so it will not be forgotten.