Feature Request for html to ps

Helge Blischke h.blischke at acm.org
Mon Jan 23 07:08:06 PST 2012


chandrashekar wrote:

>> chandrashekar wrote:
>>
>> > Hi,
>> >
>> > Is der any specific filter which handles html to postscript conversion.
>> > I saw texttops recognises text/html and get printed, but the flaw here
>> > is it will print the tags along with the contents of html. Is there any
>> > specific filter which prints html file without tags printing like a
>> > normal document printing. Is the feature not supported or any
>> > development is in progress.
>> >
>> > Regards,
>> > chandrashekar
>>
>> I've just started to set up a htmltops filter on the basis of the
>> html2ps
>> script by Jan Kärrman (Uppsala Univerity, Sweden), as it supports
>> a functional subset of CSS2 style sheets (via a configuration file)
>> and has no graphic library dependencies like gtk or fltk etc.
>>
>> I think a first usable version will be available during the next week.
>>
>> Helge
>>
> 
> Dear Helge,
> 
> what ever you had referred for html2ps script it is in perl language. I
> tested this feature on Linux box it is working fine. My understanding is
> if you could provide html2ps in C binary then overhead of perl interpreter
> would be gone. Because certain non-mac machine need perl interpreter to
> execute this script. Please consider this as a feature request.
> 
> Thanks,
> chandrashekar

Chandrashekar,

I do not know of a tool that *reliably* translates Perl code into C or C++, 
and, even worse, the html2ps script uses several modules from the Perl 
module library. Moreover, the filter I'm just hacking is a Perl script as 
well which in turn uses some of the Encode Perl modules (the reason is that 
the html2ps script does not understand UTF8, which therefore has to be 
translated to ISO8859-1).
Reprogramming all this stuff into C or C++ "by hand" would be a task of 
several months (coding "by hand" is error prone and therefore requires 
heaqvy testing) and thus far beyond what I'm willing to do.
And, from my experience over the last couple of years, CUPS filters written 
in Perl are by no means a substantial overhead (if that *really* would be an 
issue for you, you could compile the Perl scripts into Perl's internal byte 
code using perlcc which would eliminate the need of source code 
interpretation for every invokation (short of eval statements, of xourse).

For an opinion independent from me, see:
http://stackoverflow.com/questions/1114789/how-can-i-convert-perl-to-c

Helge





More information about the cups mailing list