Mobileread
Convert .lit directly into .IMP formats
#1  nrapallo 02-14-2008, 03:01 PM
A while ago, I used this procedure to convert many .lit files into .IMP formats (EBW 1150 and REB 1200).

This information was originally posted to the REB 1200 Yahoo group, and for those who do not have access to that group, I re-post same here, namely:

1. s32lit2sb.exe - Lit2sb converter compatible with eBook Publisher 2.x (EBW/GEB 1150, REB1200,GEB2250/2200/2150 )

2. s32lit2sb-INSTRUCTIONS-by-NR.txt - Instructions on how to effectively use this program to convert .lit files into .imp (Reb 1200/GEB 1150 formats)

After setting this up, one "double-click" and your .lit file gets converted. Note, you can also use batch files to convert en-masse!

Enjoy!

-Nick

EDIT 14 Feb 2008: added batch files to convert all .lit files in a directory to .IMP. Must read the instructions first, create the empty file 'GEB1150' and ensure you 'associate' .lit as described therein, and properly place all required programs in your 'path'. After that, double-click 'NRconvert lit to 1150 imp.bat' and wait for your results. By the way, when you double-click just the .lit file in windows explorer, you must manually rename the 'o_sb.imp' file; when using these batch files (even for one .lit), it's all done for you.

EDIT 23 Aug 2008: I have re-compiled a windows executable (Lit2sb.exe) based on a modified copy of that perl script to allow proper conversions. Just replace the original lit2sb.exe executable with the one in the lit2sb.zip attachment in the thread Original Lit2sb perl script RESURRECTED!
Among the things fixed were:
- uses source .lit filename as final .imp output filename and places resulting .imp in the same directory as the .lit source.
- for resulting .imp and .opf, no longer uses 8.3 filenames.
- uses "2%" left and right margins now, instead of "18pt"
- properly scales GEB1150/EBW1150 cover image so as to avoid bottom margin bleeding.
- fixed system calls to external programs to properly prefix path.


p.s. thanks to zelda_pinwheel for inspiring me to write this
[zip] s32lit2sb.zip (1.17 MB, 2431 views)
[txt] s32lit2sb-INSTRUCTIONS-by-NR.txt (4.6 KB, 1859 views)
[bat] NRconvert lit to 1150 imp.bat (492 Bytes, 1646 views)
[bat] NRlit1150.bat (613 Bytes, 1611 views)
Reply 

#2  JSWolf 02-14-2008, 03:44 PM
I've just made this thread a sticky to make it easier to find/see.
Reply 

#3  zelda_pinwheel 02-14-2008, 07:04 PM
Nick, you are my hero ! i just tried this automatic conversion and it worked a treat ! in under 30 seconds i had a nice, readable, .imp version of my .lit file.

of course, then i spent 2 hours "fixing" the code so it would be even nicer, but
i *could* have left it alone, it would have been fine.

i also tried it on that stupid drm book i bought the other day (i think it will be the last one, as well as the first one i buy), since i was having such terrible results before. the formatting is still strange, but not the same way it was before, and infinitely better than my previous efforts. at least it's readable, and at this point i think that's really as much as i can hope for !

thanks for this !!
Reply 

#4  crazyTash 03-10-2008, 10:12 AM
Thank you so much for this post! It is very useful!
Reply 

#5  sassanik 05-23-2008, 06:28 PM
I just converted a .lit file to .imp, I can open the file just fine, however the book seems to have been aligned to the right side margin instead of the left.

Suggestions? Ideas on how to fix this?
Reply 

#6  nrapallo 05-23-2008, 06:45 PM
Quote sassanik
I just converted a .lit file to .imp, I can open the file just fine, however the book seems to have been aligned to the right side margin instead of the left.

Suggestions? Ideas on how to fix this?
The .html and .opf files are leftover when the .lit conversion is finished. You can check the .html for the <p> formatting to see if there is a <p align=right> for each line or a <style> rule making the default <p> behaviour 'p {text-align: right}'. If so, remove it of substitute 'right' with either 'left' or 'justify'.

To re-create the .imp ebook, after editing the .html as per above, you should use the (free) eBook Publisher software from ETI. Even though eBookwise Librarian can create ebooks, the eBook Publisher software allows better control but however needs much more working knowledge of HTML.
Reply 

#7  sassanik 05-23-2008, 07:04 PM
Okie I opened the html file in ebook publisher. Now I am just not sure what I need to change:

<html>
<head>
<style type="text/css">
<!--
body {margin-left:18pt; margin-right:18pt; x-sbp-widow-push:1; x-sbp-orphan-pull:1}
td {vertical-align:top}
table.hdr {width:100%; border:none; margin-left:0pt; margin-right:0pt}
td.hdrl {text-align:left}
td.hdrc {text-align:center}
td.hdrr {text-align:right}
.plain {text-decoration:none; font-style:none; font-weight:none; font-size:x-small; font-family:serif; color:#000000}
header {display:none; displayeb-page-head; oeb-column-number:1; margin-bottom:10pt}
footer {display:none; displayeb-page-foot; oeb-column-number:1; margin-top:10pt}
pbrk {page-break-before:always}
.KWN {page-break-inside:avoid}
fn {font-size:-1}
sp {font-size:-3}
adv2lm {sbp-advance:left}
p {margin-top:0pt; margin-bottom:0pt; text-align:left; text-decoration:none; font-style:none; font-weight:none; font-size:x-small; font-family:serif; color:#000000}
a {color: #0000ff}
p.FullPagePicture, li.FullPagePicture, div.FullPagePicture
{margin-left:0cm;
text-align:center;
font-size:12.0pt;
}
-->
</style>


Should I set style to left align? It looks like the text is set up to left align, I think....

Amy

Edit-

The first few pages are aligned to the left, then after the acknowledgements it goes to right. So I am guessing somewhere in there a right align command got thrown in.
Reply 

#8  nrapallo 05-23-2008, 09:23 PM
Quote sassanik
Okie I opened the html file in ebook publisher. Now I am just not sure what I need to change:

...

Should I set style to left align? It looks like the text is set up to left align, I think....

Amy

Edit-

The first few pages are aligned to the left, then after the acknowledgements it goes to right. So I am guessing somewhere in there a right align command got thrown in.
The top of the .html file looks OK, but it appears you've found your answer in bold above! Just open the .html in eBook Publisher or any text editor (like notepad) and search for:
Code
right
or
right"
and look for text around the acknowledgement that includes a 'text-align' or <table align=right> there. Chances are the end of the acknowledgment doesn't 'close' the alignment.

This is probably a clitch/error in the original code that was somehow 'overlooked' by the MS LIT reader.

If you can't find it, post here the area around the acknowledgment and include enough to show the text body, before and after. When you post the text here, just place it between
Code
[ CODE ] place text here [ /CODE ]
(click the '#' in the edit bar above the Message area when entering your message.)
Reply 

#9  drudo 08-07-2008, 10:34 AM
Can someone help with this? First, it seems the html2sb program is missing when I install lit2sb. I tried downloading that and adding it, but to no avail. When I set it all up like it says in the instructions and run the bat file, the .lit file gets expanded into a subfolder and it looks like the opf file gets renamed, but no imp file is generated. If I try running html2sb on it's own, it crashes. Am I missing something? I basically end up with a .lit file and a directory full of html, images, and opf files. Any idea why this wouldn't work?

Thanks.
Reply 

#10  nrapallo 08-07-2008, 11:11 AM
Quote drudo
Can someone help with this? First, it seems the html2sb program is missing when I install lit2sb. I tried downloading that and adding it, but to no avail. When I set it all up like it says in the instructions and run the bat file, the .lit file gets expanded into a subfolder and it looks like the opf file gets renamed, but no imp file is generated. If I try running html2sb on it's own, it crashes. Am I missing something? I basically end up with a .lit file and a directory full of html, images, and opf files. Any idea why this wouldn't work?

Thanks.
First, html2sb is "broken" under current versions of Windows and especially so if eBook Publisher is installed. I can't get it to run now, even though I used it 4 or 5 years ago and perhaps under Win98se. It is not required as part of the 'lit2sb' package and usage. Just avoid it.

The resulting .imp should be located in the directory where your .lit resides. Did you "double-click" the .lit file to launch the conversion?

Now if you did the above, the .imp conversion may have been halted due to errors in to .opf or .html. Just load the .opf in eBook Publisher and try to build your .imp edition. Was it successful?

If not, then review the Messages log and see if anything needs fixing.

If not, to see if your installation of lit2sb is working, try to convert another .lit file to see if that one works.

If not, private message me with some details of your failed conversion attempt.
Reply 

  Next »  Last »  (1/3)
Today's Posts | Search this Thread | Login | Register