chm file conversion?

Andrew Pantyukhin infofarmer at gmail.com
Tue Jan 30 00:58:37 UTC 2007


On 10/14/05, Sandy Rutherford <sandy at krvarr.bc.ca> wrote:
> >>>>> On Sun, 9 Oct 2005 12:51:43 +0400,
> >>>>> "Andrew P." <infofarmer at gmail.com> said:
>
>  > On 10/9/05, Sandy Rutherford <sandy at krvarr.bc.ca> wrote:
>  >> Colin,
>  >>
>  >> On Sat, 08 Oct 2005 you wrote:
>  >>
>  >> > Vizion wrote:
>  >> >> As per subject - does anyone know of any utils for converting microsofts
>  >> >> compiled help files for use on freebsd?
>  >>
>  >> > I've found converters/chmview to be useful in the past.
>  >>
>  >> Anything available for converting chm to pdf or ps?  I believe that
>  >> there are some programs for doing this under MS Windows.
>
>  > Just print it to a ps file. Pdf and ps are easily
>  > interconvertible.
>
> I know.  That's not the issue.  xchm only supports printing one page
> at a time, which a cumbersome way to go about printing the entire
> document to file.  There is a box in the print dialogue that you can
> tick in order to print the entire document.  However, it doesn't work.

I've just stumble upon a similar task. The way I went is
decompiling chm with archmage into separate html files,
concatenating the ones I need into one with cat, and
cleaning the result up with a simple perl script (below).

Printing an html file is another problem (it's not that
easy to print 2Mb of html text)...

sat at amilo:~% cat bin/cleanchm
#!/usr/bin/perl -wT

use strict;

local $/;
local $_ = <>;
s|\<\/?html\>||g;
s|\<META.*?\>||gs;
s|\<head.*?head\>||gs;
s|\<script.*?script\>||gs;
s|\<\/?body\>||g;
s|\<table.*\n.*\n.*prev.*\n.*\n.*next.*\n.*table\>||g;
s|\<span class="v1".*?span\>||gs;
print;


More information about the freebsd-questions mailing list