Thread: SBPubX Builder
View Single Post
Old 01-30-2008, 03:30 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
Example perl scripts using SBPubX

Over the past month, I have been experimenting with command-line based perl scripts to create .IMP files directly from .htm source file(s).

The resulting .IMP appears identical to that produced by the eBook Publisher software; as it should as the SBPubX interface calls are being used.

In particular, I have adapted three perl scripts as listed in "SBPubX.doc" (installed by the eBook Publisher software) and have attached them below along with a sample .htm input file.

First, the perl script 'buildIMP.pl' has been "hard-coded" with the input file 'Crtso.htm' and produces a .IMP file in REB 1200 format as it stands. The output format can easily be changed to GEB/EBW 1150 or REB 1100 by editing this perl script and only uncommenting the {BuildTarget} line for the required output format. In addition, the ebook metadata as well as input .htm file can easily be changed by editing the 'buildIMP.pl' script.

Executing the buildIMP.pl script will also create/save a .opf project file that will be used by the other two perl scripts provided below.

Second, the perl script 'examineOPF.pl' again takes its input from a "hard-coded" entry (I am just learning perl and will hopefully soon make these scripts more universal and useful!). It prints out to stdout metadata details about the .opf project file.

Third, the perl script 'validateOPF.pl' takes the same input as above and prints out raw warning/error messages encountered; again just like eBook Publisher!

My aim here is to show how easy it is to produce .IMP/.OPF files using SBPubX interface calls via command-line scripts/batch files and not to provide working full-featured scripts.

By the way, I am in the process of automating the conversion of the Blackmask DVD v1 (with approx. 11,000 ebooks) into REB 1200 .IMP and GEB/EBW 1150 .IMP formats with a better title page and "fixes" for pet peeves of mine regarding lack of margins, messy TOC and hard to read font size. I am basically using a batch file created from 'buildIMP.pl' using pl2bat.bat and deploying my "fixes" therein. I am striving to properly retain the ebook's metadata i.e. title, author and category in the resulting .IMP!

Hope this helps with your exploration of SBPubX.

-Nick
Attached Files
File Type: zip SBPubX_example_scripts.zip (988.2 KB, 968 views)
nrapallo is offline   Reply With Quote