Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Other formats > IMP

Notices

Reply
 
Thread Tools Search this Thread
Old 08-26-2008, 05:08 AM   #1
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
impmake: automated creation of IMP books via the command line

NOTE: impmake has now been renamed to ebookutils, and is hosted at http://gitorious.org/projects/ebookutils using Git, which should easily allow other developers to make changes. I plan to merge impserve, impmake, 2 new python utilities which replace ebw1150+rebcomm and pdfread under this umbrella.

This is impmake, a utility for creating ebooks for the 1100/1150/1200 from HTML source files. It requires the installation of eBook Publisher. In case this is not installed, you may get an error:

Code:
    Execution failed at src/impmake.c:159 while attempting to execute
        dhCreateObject(L"SBPublisher.Project", NULL, &impProject)
To compile the code, you will need MinGW with MSys. Just switch to the directory where you extracted the files, and type "make" from Msys command prompt (There's a precompiled version available in the download).
Code:

Usage: impmake [-OPTIONS] FILES [...]

-h, --help     Show this help message.
-s, --save     Specify the project to save as.
-a, --author   Specify the book's author.
-t, --title    Specify the book's title.
-c, --category Specify the book's category.
-d, --out-dir  Specify the output directory.
-n, --name     Specify the book name.
--isbn         Specify the book's ISBN
--pubdate      Specify the book's publishing date
--publisher    Specify the book's publisher
--language     Specify the language for the book.

--1100, --1150, --1200, --oeb
               Specify the target device to use for book creation.

--zoom-small, --zoom-large, --zoom-both
               Specify the zoom states to be supported in the book

--no-underline Specify that links should not be underlined.
--no-img-conv  Specify that image auto conversion to JPG should be disabled.
--no-img-scale Specify that image pre scaling should be disabled.
--compress     Specify that the compression is to be used.
--keep-anchors Specify that link anchors should be kept in output.
I plan to host this later at SourceForge or something similiar, after trying to coordinate a super-archive of all the tools currently available for the REB 1100/1150/1200 eg. libreb, rbmake, rebcomm, eb1150, and the planned-for browsing proxy.

Changes in 0.2:
- convert relative to absolute paths when referring to files/directories
- add a --log option which generate a log from the publisher itself (can be useful for debugging errors)

Changes in ebookutils-0.3:
- impmake: add an -f option to specify the files to be included, with one file per line
- impserve: handle paging of booklist requests
- impserve: handle downloading of IMP books which are sent as an attachment (direct download of IMP from mobileread works)
- impserve: implement a plugin system and provide 2 default plugins to change the URL/content before being sent to the device.
- impserve: refactored the code heavily, please run impserve/run.py from python.

To get it working in WINE, you'll need to perform the following:
  1. Remove or backup your existing wine folder (e.g. using rm -fR ~/.wine)
  2. Download winetricks and run "sh winetricks vcrun6"
  3. Install eBook Publisher
  4. run "sh winetricks dcom98" and click Yes twice.
Now you can try running wine impmake.exe <other-params>
Attached Files
File Type: zip impmake.zip (29.6 KB, 802 views)
File Type: zip impmake-0.2.zip (30.6 KB, 803 views)
File Type: zip ebookutils-0.3.zip (61.5 KB, 810 views)

Last edited by ashkulz; 08-30-2008 at 08:00 PM. Reason: add ebookutils-0.3
ashkulz is offline   Reply With Quote
Old 08-26-2008, 09:22 AM   #2
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
Great effort!

I used to use rbmake with my REB1100 all the time because of its simplicity and power. You seem to have duplicated that with impmake.

I tried compiling it under Cygwin (what I have installed right now in WinXP) and got an error since I don't have "tchar.h".

I know it's in "/usr/include/mingw" and it's not a good idea to mix these two installations, BUT is there a workaround to using tchar.h for the moment?

I don't feel like installing mingw right now as I finally have my Cygwin implementation setup again. Do you know the full Cygwin installation downloaded over a GIG of stuff and took several hours to complete?

Let me play with this a bit later today before asking any more questions...
nrapallo is offline   Reply With Quote
Advert
Old 08-26-2008, 11:08 AM   #3
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
Quote:
Originally Posted by nrapallo View Post
I know it's in "/usr/include/mingw" and it's not a good idea to mix these two installations, BUT is there a workaround to using tchar.h for the moment?

I don't feel like installing mingw right now as I finally have my Cygwin implementation setup again. Do you know the full Cygwin installation downloaded over a GIG of stuff and took several hours to complete?
You might want to use the -mno-cygwin flag for getting it to compile. MinGW is just a ~12Mb download, so I'd recommend you download it anyway -- no dependency on cygwin1.dll. Also, I do hope you noticed that the compiled EXE is in the archive anyway so you don't need to compile it again :-)

I plan to work on PDFRead in the next few weeks, and one of the first things I will do is use this instead of directly using COM from Python -- which should reduce the installation size quite a bit. I think you can take a similiar approach for the html2mobi which is done in Perl, I think...
ashkulz is offline   Reply With Quote
Old 08-26-2008, 11:12 AM   #4
DixieGal
Hi There!
DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.
 
DixieGal's Avatar
 
Posts: 7,473
Karma: 2930523
Join Date: Feb 2008
Location: Ft Lauderdale
Device: iPad
Thank you! I haven't the foggiest idea what to do with it, but I'm grateful for everything you and Nick are doing to keep IMP format alive so that we can continue using our beloved EB=1150's.

DixieGal is offline   Reply With Quote
Old 08-26-2008, 11:14 AM   #5
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by ashkulz View Post
This is impmake, a utility for creating ebooks for the 1100/1150/1200 from HTML source files. It requires the installation of eBook Publisher. In case this is not installed, you may get an error:

I plan to host this later at SourceForge or something similiar, after trying to coordinate a super-archive of all the tools currently available for the REB 1100/1150/1200 eg. libreb, rbmake, rebcomm, eb1150, and the planned-for browsing proxy.

Also, this should work in Wine as-is so that one can have an all-linux solution for your 1150/1200.
You might want to use the development environment provided here at mobileread. Click the DEV HUB entry at the top of the screen. Sounds great by the way.

Dale
DaleDe is offline   Reply With Quote
Advert
Old 08-26-2008, 11:17 AM   #6
DixieGal
Hi There!
DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.
 
DixieGal's Avatar
 
Posts: 7,473
Karma: 2930523
Join Date: Feb 2008
Location: Ft Lauderdale
Device: iPad
Quote:
Originally Posted by DixieGal View Post
Thank you! I haven't the foggiest idea what to do with it, but I'm grateful for everything you and Nick are doing to keep IMP format alive so that we can continue using our beloved EB=1150's.


And Dale, thank you also!!
DixieGal is offline   Reply With Quote
Old 08-26-2008, 11:44 AM   #7
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 ashkulz View Post
You might want to use the -mno-cygwin flag for getting it to compile. MinGW is just a ~12Mb download, so I'd recommend you download it anyway -- no dependency on cygwin1.dll.
Thanks for the heads up! It will be the next install on my list. I really hate having to also use that cygwin1.dll.
Quote:
Also, I do hope you noticed that the compiled EXE is in the archive anyway so you don't need to compile it again :-)
First thing I did after unzipping your file was to rename your executable so that I could get it compiled. It was almost a knee-jerk reaction since I've done this a thousand times before; download someone else's code and compile it! I still haven't used your .exe because I'm too busy solving my (unimportant) compile problem. Boy do I have my priorites all screwed up!
Quote:

I plan to work on PDFRead in the next few weeks, and one of the first things I will do is use this instead of directly using COM from Python -- which should reduce the installation size quite a bit.
Great News! Will you host it on SourceForge as I think the DEV HUB here doesn't allow co-developers (hint-hint) as suggested by DaleDe.
Quote:
I think you can take a similiar approach for the html2mobi which is done in Perl, I think...
I think I'll wait for you to "pioneer" that method, and then I will follow (copy) with something similar in Mobi2IMP!

We (actually Ret) just got the EBW1150 proxy browser working (check here) so I hope this will aid in your proxy browser/librarian effort!

We may need a "Developer's Corner" sub-forum in the Fictionwise forum now...

Thanks for all your help keeping the .imp format alive!!!
nrapallo is offline   Reply With Quote
Old 08-27-2008, 04:25 AM   #8
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
Made a new release (impmake-0.2) with the following changes:

- convert relative to absolute paths when referring to files/directories
- add a --log option which generate a log from the publisher itself (can be useful for debugging errors)

Note that 0.2 doesn't work in Wine yet, it fails at ValidateManifest. I am still investigating that.
ashkulz is offline   Reply With Quote
Old 08-27-2008, 07:52 AM   #9
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
I am getting the same sort of error with wine but with version .01 I think. Downloaded it yesterday.
Code:
Execution failed at src/impmake.c:191 while attempting to execute
  dhCallMethod(impBuilder, L".ValidateManifest(%o)", impProject)
As the versions go up you might want to add a --version switch as I'm not sure which one I have, but I think it is .01.

Ok looked back at the first post where the files are and it is .01 that have as .02 is labeled .02. Brain isn't working today.

Last edited by derrell; 08-27-2008 at 07:55 AM. Reason: Slow mental processes
derrell is offline   Reply With Quote
Old 08-27-2008, 09:19 AM   #10
GeneS
eBook Enthusiast
GeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enough
 
GeneS's Avatar
 
Posts: 120
Karma: 726
Join Date: Dec 2007
Location: US
Device: Sony PRS-350, Astak PocketPro, iPhone, Asus eee Pad Transformer
Wonderful.
It works like a charm as far as I have been able to go -- and FAST, too. It could be that I'm not crossing my fingers as I proceed, but images don't show up in the resulting .imp file regardless of whether they're in the directory with the html file or not. Apparently there's something I've overlooked. The log file indicates:

Error: A link to a non-existent anchor ("\H:\HTML2imp\images\Illus_1.jpg") was found. Ignoring link ...

Could it be the beginning backslash that it inserts into the search path?

Thanks for your work on this.

Gene

Last edited by GeneS; 08-27-2008 at 10:46 AM. Reason: added line from logfile
GeneS is offline   Reply With Quote
Old 08-27-2008, 11:30 AM   #11
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
Quote:
Originally Posted by GeneS View Post
The log file indicates:

Error: A link to a non-existent anchor ("\H:\HTML2imp\images\Illus_1.jpg") was found. Ignoring link ...

Could it be the beginning backslash that it inserts into the search path?
Can you post a zip of your HTML here (or PM me with a link), so that I can debug it?

And yes, both versions don't work in WINE (but eBook Publisher does). Apparently, it is something to do with the path-translation WINE does which causes the COM functions to return an E_FAIL (generic error) -- at least, that's what I think for now.
ashkulz is offline   Reply With Quote
Old 08-27-2008, 11:45 AM   #12
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
I asked about co-author in the DEV HUB and it is already implemented according to Alex.

The person who creates the project (the "owner") can give other people (who must be registered on the dev hub) full access to the project's repository.

He needs to go to Admin -> Subversion Access.
DaleDe is offline   Reply With Quote
Old 08-27-2008, 11:46 AM   #13
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 DaleDe View Post
I asked about co-author in the DEV HUB and it is already implemented according to Alex.

The person who creates the project (the "owner") can give other people (who must be registered on the dev hub) full access to the project's repository.

He needs to go to Admin -> Subversion Access.
Wow, where did that upgrade slip in. Good to know, Dale!
nrapallo is offline   Reply With Quote
Old 08-27-2008, 11:46 AM   #14
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by GeneS View Post
Wonderful.
It works like a charm as far as I have been able to go -- and FAST, too. It could be that I'm not crossing my fingers as I proceed, but images don't show up in the resulting .imp file regardless of whether they're in the directory with the html file or not. Apparently there's something I've overlooked. The log file indicates:

Error: A link to a non-existent anchor ("\H:\HTML2imp\images\Illus_1.jpg") was found. Ignoring link ...

Could it be the beginning backslash that it inserts into the search path?

Thanks for your work on this.

Gene
Certainly, backslashes should never be used in html.

Dale
DaleDe is offline   Reply With Quote
Old 08-27-2008, 02:19 PM   #15
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
Quote:
Originally Posted by derrell View Post
I am getting the same sort of error with wine but with version .01 I think. Downloaded it yesterday.
Code:
Execution failed at src/impmake.c:191 while attempting to execute
  dhCallMethod(impBuilder, L".ValidateManifest(%o)", impProject)
As the versions go up you might want to add a --version switch as I'm not sure which one I have, but I think it is .01.

Ok looked back at the first post where the files are and it is .01 that have as .02 is labeled .02. Brain isn't working today.
Ok, here's a quick way to get it working in WINE.
  1. Remove or backup your existing wine folder (e.g. using rm -fR ~/.wine)
  2. Download winetricks and run "sh winetricks vcrun6"
  3. Install eBook Publisher
  4. run "sh winetricks dcom98" and click Yes twice.

Now you can try running wine impmake.exe <other-params>
ashkulz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
<Command Line> Add multiple books in multiple formats himitsu Calibre 8 09-25-2010 11:07 PM
adding books via command line in msdos batch FlaKate Calibre 1 12-25-2009 01:12 AM
Where are the command line tools? PaulChernoch Calibre 17 10-23-2009 12:08 PM
Adding books from the command line edembowski Calibre 1 08-29-2009 11:18 AM
Why use the command line? slantybard Calibre 6 07-22-2009 12:17 PM


All times are GMT -4. The time now is 11:55 PM.


MobileRead.com is a privately owned, operated and funded community.