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.

Device: eb1150 & is that a nook in her pocket, or she just happy to see you?

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 !

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.

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?

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.

AND when you get those installed, you can get direct .lit/.pdf/.prc to .imp conversion while surfing the internet as well (though it's less efficient), using Impserve as discussed in this thread!
(your plugins would all be setup then, just download the latest release here!)

1) The LIT2SB tool is having problems with the CSS file. Calibre is using an tag called

Code:

@namespace h "http://www.w3.org/1999/xhtml";

Since it doesn't understand this it is showing up in the generated IMP file.

2) The order of the content page is incorrect. The tool assumes the <manifest> data will be in sequential order and process the IMP OPF that way. Calibre's OPF file does is not in sequential order but properly laysout the the ID in the <spine> tag so that the order is correct. This results in chapters, TOC, and cover pages to be shuffled around in the IMP book.

3)The cover.htm file assumes an image Cover_SB.jpg but this file is not created. However there is a cover.jpg and it is in calibre's OPF file.

This tool was developed about 5 years ago when there were only MS-commissioned .lit ebooks and so the program, Lit2sb.exe, does not know how to handle any of the inconsistencies introduced by the calibre .lit encoding method.

However, I was able to RESURRECT the original Lit2sb Perl script and so it can be manipulated (re-coded) to suit! At the time I had "extracted" that Perl script, I also "tweaked" it to better produce .imp ebooks so I can and have produced new windows executables of lit2sb.exe.

I mainly wrote the INSTRUCTIONS on how to effectively use this tool so my knowledge of this program comes only from reading the Perl code. I could recompile it quite easily if you know the exact patches you need implemented (otherwise there may be some heavy debugging to do ).

Either send me a problematic .lit file or attach it here and let's see what's needs to be done to make this work for calibre generated .lit ebooks.