views:

313

answers:

1

I want a way to convert some basic html tags into RTF (like I, B, BR) Is there any simpler way to do that without paying for anything? Developing something from scratch is an option too.

+7  A: 

Have you tried HTML::FormatRTF? I haven't used the RTF output, but I've used the plain text output (HTML::FormatText) and was happy with it.

cjm
Thanks cjm, This looks promising. But I am stuck with this.HTML::Format depends on HTML::Tree and HTML::Tree depends on HTML::Parser. While doing 'make test' for HTML::Parser i got following error:t/entities...........NOK 17# Failed test (t/entities.t at line 74) # got: 'Attention Homenrs...1t Te E'# expected: 'Attention HomeοÏnÓ©rs...1Ñt TÑмe Eνөг'# Looks like you failed 1 test of 17I verified that i satisfy pre-requisites for installing this module.Any idea about this error?
Sam
HTML::Parser is a heavily used module; it should work fine. Are you using the current version (3.64)? If you can't get it to work, post another question giving details of your Perl installation, OS, and error message. Comments aren't a suitable medium to diagnose it.
cjm
Sam: I guess you use an old version of Perl, before 5.8. You should report this bug here: https://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Parser
Alexandr Ciornii
I use 5.6.1 for Perl and I am using 3.64 for Parser. OS is Solaris 8
Sam
Well, HTML::Parser still claims to support 5.6, so report the bug as Alexandr suggested. But you really ought to upgrade your Perl; 5.6.1 is almost 9 years old now. Lots of current modules don't support it at all. (You can get older versions of HTML::Parser from http://backpan.perl.org/authors/id/G/GA/GAAS/ that may work better with your ancient Perl.)
cjm