"meneerjansen" <me**********@europe.be> wrote in message
news:c3**********@reader13.wxs.nl...
Greetings,
I'm looking for a Perl script (or a platform-independent exe outputting to
STDOUT) that converts chm (HTML Help) files to text or HTML.
Does anyone know if such program exists?
Thanks for your time,
Janssen
(platform independent)
Check out the CHM Tool source code here:
http://www.speakeasy.org/~russotto/chm/
If you are on Win32, you can use
this code to extract a page from a chm:
# win32 chm page extractor
#########################
#!/usr/bin/perl
# use Win32::OLE;
my $chmfile = "The Perl CD Bookshelf.chm";
my $HTTP = Win32::OLE->new('MSXML2.XMLHTTP.3.0') or
die "couldn't create MsXml2 object \n";
# strings contains the toc, main, and index page names
my $src = "ms-its:$path/" . $chmfile . "::#STRINGS";
# get using the M$ InfoTech Storage protocol
my $str = ChmGet( \$HTTP, $src);
sub ChmGet
{
my ($obj,$url) = @_;
$$obj->Open( "GET", "$url" , "FALSE");
$$obj->Send();
my $lRes = 0;
$lRes = Win32::OLE->LastError();
if ($lRes ) {
return $lRes;
}
else
{
return $$obj->{responseBody};
}
}
# end script
This code was developed in a project to data_mine
my CHM ebook collection and to insert the results
into MySQL.
I have about 43,000 chapter headings that I can
search with SQL queries. Query results are formatted
as anchor tags in an HTML interface, which when
clicked will open the desired page to the desired chapter.
A single ebook collection can be browsed across
a LAN.
I've looked into doing the same with PDF, but never
got to square-one.
good luck,
msp
AIM:Yahoo:tlviewer