10-18-2008, 01:06 AM | #16 | |||||
GuteBook/Mobi2IMP Creator
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:
Quote:
Quote:
I tried the ActivePerl Tk widget.bat demo and others and all I can say is WOW!!! I've got to learn this (in between ebooks conversions)! Quote:
Quote:
|
|||||
10-18-2008, 01:18 AM | #17 |
Jack O' Apes
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
|
I've never been able to get mobi2IMP to work under wine. Thats why I wrote a script that would work with the BuildFromProject method from the BookMillX api. Just feed it an opf and viola imp file. Seemed like the simplest way to avoid a lot of work arounds with wine. Calibre and convert lit work fine under linux and with perl I can chop up the opf and redo it so that eBook Publisher likes it.
|
Advert | |
|
10-18-2008, 01:24 AM | #18 | |
GuteBook/Mobi2IMP Creator
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:
What's BookMill com interface or BookMillX api? linux or Mac OS X modules? |
|
10-18-2008, 03:43 AM | #19 |
Jack O' Apes
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
|
Should have said the eBook AutoPublisher from eti. The perl and VB interface that comes with eBook Publisher. The title that shows in a tab with the docs open is BookMillX - COM started thinking of it by that name. Using that I only have one call to a windows script running under wine to get an imp book from a set of files.
|
10-18-2008, 08:16 AM | #20 |
GuteBook/Mobi2IMP Creator
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
|
Oh, I see. That's where I got started programming in perl earlier this year! See my first mobileread post or the one with working perl scripts.
So after installing eBook Publisher using wine, what do you call to create the .imp? Is it detailed in your EBookwise-1150-Linux wiki page? Mobi2IMP.pl uses the .imp creation routine I "lifted" from the SBPubX.doc COM interface doucmentation that ships with eBook Publisher. It basically calls '$builder->Build($project);' to create the .imp. You use 'BuildFromProject', but how is it different than what I'm calling that doesn't make it work! BTW, lit2imp.pl DOES use '$builder->BuildFromProject($opf_file);', so does it create a .imp from a .lit in liunx for you? Maybe you can try tweaking Mobi2IMP.pl to work properly in linux using 'BuildFromProject' instead of just 'Build'? Can you confirm what works for you? and what script do you use? I'll make the change permanent in Mobi2IMP.pl, if it works for both linux and windows! |
Advert | |
|
10-18-2008, 07:49 PM | #21 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
My PerlTK programs usually starts out non-OO but when they grow they become a mess so I ususally add OO at some point. |
|
10-18-2008, 09:22 PM | #22 | ||
Jack O' Apes
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
|
Quote:
Quote:
Yeah, at some point I'm going to have to break down and get comfortable with writing OO but since this is a hobby I just haven't taken the time to do it. My day job, or I should say night job since I work the graveyard shift, is being a machinist. |
||
10-18-2008, 09:51 PM | #23 | ||||
GuteBook/Mobi2IMP Creator
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:
Quote:
Quote:
Quote:
|
||||
10-19-2008, 12:08 AM | #24 | |||
Jack O' Apes
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:
Quote:
Quote:
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; Code:
wine perl c:\\bin\\opf2imp.pl Mass_Effect_Revelation.opf Last edited by derrell; 10-19-2008 at 12:23 AM. |
|||
10-19-2008, 08:26 AM | #25 | |||
GuteBook/Mobi2IMP Creator
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:
Code:
pp -o ..\bin\Mobi2IMP.exe mobi2imp.pl 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:
Quote:
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); } 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 08:34 AM. |
|||
10-19-2008, 10:19 AM | #26 | |
Jack O' Apes
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
|
Quote:
I haven't tried lit2sb. After trying to get the mobi2imp.pl to work I sort of gave up on using windows apps. I've been trying to use them as little as possible during the conversion. Things are simpler that way Mobiperl works fine under just linux. It would run into the same problems though under wine. I can't install any perl modules from activestate into the windows perl installation. As I said there is most likely a way around that but I didn't ever find it. |
|
10-22-2008, 09:53 AM | #27 | |
GuteBook/Mobi2IMP Creator
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:
To use mobi2imp.pl, I started by first setting up eBook Publisher and the imp viewer as per your wiki writeup, and it's working just fine! I downloaded and installed tompe's mobiperl and used cspan to get the required modules. I couldn't get GD to install, so I had to download and install libgd first (all done using sudo!). Then I had to move the MobiPerl and Palm libs to /usr/local/lib/perl/5.8.8 for them to be recognized by my ubuntu 8.04 default perl setup! Mobiperl now also works!!!! OK, how do I use just mobi2imp.pl? If I issue, perl mobi2imp.pl, I get that it couldn't find Win32/OLE.pm. I think you said you have to install ActivePerl under wine to use your opf2imp.pl script above. Is that right, I have to download the windows version of ActivePerl and install under wine, even though I already have perl installed on this linux box? I just want to get your script and my mobi2imp.pl working, but both are missing the OLE.pm. It's not possible to just copy OLE.PM to the linux installation, right? I issued your wine command above, but it complained that perl.exe could not be found, hence the need for ActivePerl to be installed there using wine, right? Sorry for all the basic questions, but I'm learning this as I go. Last edited by nrapallo; 10-22-2008 at 09:56 AM. |
|
10-22-2008, 11:50 AM | #28 |
Jack O' Apes
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
|
Ok hold on if you are checking this thread for an answer. I'm working on it but involves a lot of typing its going to take a bit.
|
10-22-2008, 12:30 PM | #29 | |
GuteBook/Mobi2IMP Creator
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:
Oh, by the way, no hurray for the response; I'll wait until you've got the time to write it up (what other choice do I have ) Thanks, derrell! |
|