Thread: impfind
View Single Post
Old 10-19-2008, 12:08 AM   #24
derrell
Jack O' Apes
derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.
 
derrell's Avatar
 
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
Sorry for being unclear.

Quote:
Originally Posted by nrapallo View Post
Which .exe are you referring to? ebookpub or Mobi2IMP GUI? Just use the perl .pl scripts instead of the .exe, no?
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.

Quote:
Originally Posted by nrapallo View Post
So if you gave mobi2imp.pl (perl script) the mobi.prc, wouldn't it generate a .imp if you used BuildFromProject? If you send me/post the script, I can try to see if it is different from what I do. I haven't yet used/setup wine in ubuntu since I primarily use windows for ebook creation.
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.

Quote:
Originally Posted by nrapallo View Post
I understand from ashkulz that using impmake in linux requires you to jump through hoops, but if you don't with your script, then there could be a native way to generate a .imp from a .opf. I think we are on the right track here...
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.

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.

Code:
#!/perl/bin/perl -w

use strict;

use Win32::OLE; 

Win32::OLE->Initialize(Win32::OLE::COINIT_APARTMENTTHREADED); 


my $builder = Win32::OLE->new("SBPublisher.Builder") or 

        die "Unable to get IBuilder interface\n";


 
my ($opf) = @ARGV;
$builder->{TargetDevice} = 2;

$builder->BuildFromProject($opf);

if (Win32::OLE->LastError() != 0) { 

        print "ERROR: Build method failed.\n";

} else { 

        print "Done!\n";

} 

print "Path to file " . $builder->{OutputFilename} . "\n"; 

Win32::OLE->Uninitialize(); 
exit;
And the wine command line.
Code:
wine perl c:\\bin\\opf2imp.pl Mass_Effect_Revelation.opf

Last edited by derrell; 10-19-2008 at 12:23 AM.
derrell is offline   Reply With Quote