View Single Post
Old 01-03-2009, 04:37 PM   #39
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
Word2IMP.pl

I finally figured out (through trial & error) what to do to properly use BuildFromWordDoc using the Builder interface of the PubX.dll OLE library as explained here. Even though, you can convert .doc directly into .imp (even in batches) using the BulkConvert program that also "ships" with the eBook Publisher software, this perl script (Word2imp.pl) now allows pre- & post-processing changes to be made using perl scripts!

WORD2IMP
A simple batch file called Word2IMP.bat demonstrates how .IMP ebooks can be created using the workhorse routine 'Word2imp.pl'. The 'Word2imp.pl' perl script takes as input a single filename of the .rtf, .doc or .html to convert to .imp. If the filename contain spaces, then quotes need to surround the parameter!

After executing the sample batch file, the .IMP ebook is produced along with the .opf project file used internally. However, since temporary files are used to build the .imp, the source .html file created gets deleted at the end and is no longer available. A work-around is to create a .oeb ebook and then 'unpack' it to see that intermediary .html file!

Then and only then can the ebook be loaded into eBook Publisher for further processing, if necessary.
EDIT: For a revised Word2imp.pl Perl Script that produces a better .doc to .imp conversion (set CSS=1 or better still use CSS=2)) as detailed in post #41 below.
Attached Files
File Type: pl Word2imp.pl (4.8 KB, 884 views)
File Type: zip Word2imp-samples.zip (357.1 KB, 947 views)
File Type: zip Word2imp-windows-executable.zip (1,011.8 KB, 957 views)

Last edited by nrapallo; 04-23-2009 at 01:01 PM. Reason: see post #41 below for a revised Word2imp.pl Perl script
nrapallo is offline   Reply With Quote