Thread: impfind
View Single Post
Old 10-19-2008, 07:26 AM   #25
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by derrell View Post
Sorry for being unclear.

The Mobi2IMP.exe. Can't get this to run under wine. It throws errors with something to do with the par packaging. This is a wine issue because the executeable works fine under windows.
Ok understood now; the Mobi2IMP.exe is built using this command in my ActiveState Perl for Windows:
Code:
pp -o ..\bin\Mobi2IMP.exe mobi2imp.pl
If there is an alternative that works in wine then I could try using that, but it begs the question, why? Everything except the GUI part is coded in perl using tompe's mobiperl mobi2html as a base. I used his setup to get ActiveState Perl working with Mobi2IMP (see his install instructions here for the various operating systems mobiperl runs on).

Can you get mobiperl working? If so, you should be able to get mobi2imp.pl working then. I'm speaking generally/theorectically here as I know you have issues getting it to work.

However, if ActiveState Perl is supplemented with the (mobiperl) modules available at CSPAN, then it would appear that mobi2imp.pl might work except for the OLE calls to AutoPublisher, which are handled by you below and use BuildFromProject instead of Build.

Quote:
The problem with trying to run this script under wine is that all of the perl modules that it needs are not installed in the ActiveState version of perl that I have running under wine. So it isn't so much a problem with the script as it is with the installation of perl under wine. For these windows perl scripts to work you have to install a version of perl for windows in wine and then the other perl modules that the scripts need. I haven't been able to get any modules installed.


I have to jump through the same hoops to make the perl script that I wrote work with AutoPublisher. But those same hoops don't let the more complicated mobi2imp.pl script work due to the perl modules that I haven't been able to get installed under wine. There is most likely a solution for that I just got tired of fighting the whole mess.

The hoop jumping is only in the initial setup though so once I get it working, just installing some dll's, I don't have to jump through anymore hoops to use the simpler script that only relies on what ActiveState installs to begin with.
I may need your guidance setting this up in ubuntu. I couldn't find where to install wine from? Update Manager? Add Programs?

Quote:
Your automated conversion scripts work just fine in a virtual box install of XP. That requires me to be running virtual box and working in XP which is not a big deal but requires a lot file moving to get the books onto my reader which I do through linux using eb1150 and ebookutils. I have to start the virtual machine move the mobi book into that environment through a directory that is mounted as a network drive for XP. Then do the conversion and move it back into linux through the same directory and then into my bookshelf directory then I can put it on my reader. It is a hassle and being like I am I will spend a lot of hours trying to figure out how to make that easier. Probably enough hours that if I spent the same amount of time converting books through the longer method I could convert more than I could ever read.

The most common work flow for converting a lit book or a mobi book for me is this.

1. Explode the book with either Convert lit or mobi2oeb
2. Open the opf file eBook Publisher.
3. Since the opf won't open in eBook Publisher add all the information and the html files to a new project in eBook Publisher.
4. Preview the Grayscale version of the book and hope that there aren't any weird and esoteric css formating problems.
5. Save the project which overwrites the original opf file and build the imp file.
6. Archive the whole thing with the original mobi or lit along with the exploded files and imp into a zip or bzip2 file.
7. Transfer a copy of the imp file to my reader.
8. FINALLY start reading my book that I most likely paid good money for.

Sorry for the long post but once I got started I couldn't stop.

Oh and here is the perl script that I'm using under wine. Still experimental and does not provide the ebook with a unique id number.
This is the .imp generating code used in lit2sb.pl:
Code:
sub html2geb2150 {
	$opf_file = shift;
	$builder=Win32::OLE->new("SBPublisher.Builder") or
	    die "Unable to get Softbook Personal Publisher\n";
	if ($GEB1150) {$builder->{TargetDevice}="2";}
	else {$builder->{TargetDevice}="1";}
	$builder->BuildFromProject($opf_file);
}
Very similar to your script, so does lit2sb.pl work for you in linux i.e. lit2sb.pl ebook.lit yields a .imp? how about Lit2sb.exe (I know pushing it )?

Thanks for the heads up; I am now going to try all of this in ubuntu and use (well try to use ) wine with mobi2imp.pl!

Last edited by nrapallo; 10-19-2008 at 07:34 AM.
nrapallo is offline   Reply With Quote