View Single Post
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, 931 views)
File Type: zip impmake-0.2.zip (30.6 KB, 957 views)
File Type: zip ebookutils-0.3.zip (61.5 KB, 927 views)

Last edited by ashkulz; 08-30-2008 at 08:00 PM. Reason: add ebookutils-0.3
ashkulz is offline   Reply With Quote