RTF::HTML::Converter::API - OO API to Philippe Verdret's RTF::HTML::Convertor
use RTF::HTML::Converter::API; my $rtf = new RTF::HTML::Converter::API (dir => "D:/temp/",); $rtf->process; foreach (@{$rtf->{files}}){ warn $_; warn $_->{filename}; warn $_->{html},"//end//"; warn "\n"; } my $rtf = new RTF::HTML::Converter::API; warn $rtf->convert_file("D:/temp/rtf-test.rtf"); foreach (@{$rtf->{files}}){ warn $_; warn $_->{filename}; warn $_->{html},"//end//"; warn "\n"; } exit;
An OO API to Philippe Verdret's RTF::HTML::Convertor module.
Note that RTF::HTML::Convertor produces invalid HTML: see the test for details.
RTF::HTML::Convertor
Define the class variable CHAT to have a value if you wish realtime output of what's going on.
CHAT
Arguments in key=value> pairs:
key=
the directory to process.
Does everything in one method call.
Optional argument is a directory to process: default is in $self-{dir}> required at construction time.
$self-
Calls the RTF::HTML::Converter (see RTF::HTML::Converter) on every file in our files list: takes the filenames from the filename slot of each hash, and placing the resulting HTML into the html slot fo each hash.
RTF::HTML::Converter
files
filename
html
Accepts the object reference and the path to a file to convert. Pushes into the object's files array a hash with a key filename against the passed filename, and a key html with the value returned by the RTF::HTML::Converter (see RTF::HTML::Converter).
Incidentally returns a reference to the HTML created.
Does not check to see if the object already contains the processed result.
Does not use the object's dir slot.
dir
Lee Goddard (lgoddard@CPAN.org).
Copyright (C) Lee Goddard, 2002. All rights reserved. This software is made available under the same terms as Perl itself.
To install RTF::HTML::Converter::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RTF::HTML::Converter::API
CPAN shell
perl -MCPAN -e shell install RTF::HTML::Converter::API
For more information on module installation, please visit the detailed CPAN module installation guide.