RTF::HTMLConverter - Converter from RTF format to HTML. |
RTF::HTMLConverter - Converter from RTF format to HTML.
use XML::GDOME; use RTF::HTMLConverter; my $parser = RTF::HTMLConverter->new(in => 'test.rtf', out => 'test.html'); $parser->parse();
use XML::DOM; use RTF::HTMLConverter; open my $in, 'test.rtf' or die; my $parser = RTF::HTMLConverter->new( in => $in, out => 'test.html', DOMImplementation => 'XML::DOM', image_uri => "http://somewhere.net/images", codepage => 'iso-8859-1', ); $parser->parse();
use XML::GDOME; use RTF::HTMLConverter; my $html = ''; my $parser = RTF::HTMLConverter->new( in => 'test.rtf', out => \$html, discard_images => 1, ); $parser->parse();
RTF::HTMLConverter is a high-level RTF to HTML format converter. It is based on the low-level RTF parser module RTF::Lexer. Additionally, it requires the W3C's DOM implementation and it is known to work with either XML::DOM or XML::GDOME.
\*STDIN
.
See RTF::Lexer
for more information.
XML::DOM
and
XML::GDOME
. The default value is XML::GDOME
.
utf8
.
This parameter is recognized only if DOMImplementation is XML::GDOME
.
XML::GDOME
. Possible values are:
GDOME_SAVE_STANDARD
and GDOME_SAVE_LIBXML_INDENT
. See XML::GDOME::Document
for more information. Default value is GDOME_SAVE_LIBXML_INDENT
.
$name
, $publicId
, $systemId
) if
DOMImplementation is XML::GDOME
or ($name
, $systemId
, $publicId
)
if DOMImplementation is XML::DOM
. Default values are:
HTML
-//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd
img%d
.
convert
utility. Default value is simply
convert
assuming it is in one of the $ENV{PATH} directories.
mogrify
utility. If the value is undef
or
the specified file does not exists, the images extracted from RTF will
not be scaled. Default value is mogrify
.
wmf2eps
utility. If the value is undef
or the
specified file does not exists, the WMF-images will not be extracted
from RTF. Default value is wmf2eps
.
RTF::Lexer, Rich Text Format (RTF) Specification (version 1.7), The_RTF_Cookbook, RTF::Parser, RTF::Tokenizer.
And there should be lots of unknown bugs;)
Vadim O. Ustiansky <ustiansky@cpan.org>
RTF::HTMLConverter - Converter from RTF format to HTML. |