______ _______ _______ __ __ | __ \|_ _|| ___||__||__| Tokenizes RTF | < | | | ___| __ __ |___|__| |___| |___| |__||__| _______ __ __ |_ _|.-----.| |--..-----..-----.|__|.-----..-----..----. | | | _ || < | -__|| || ||-- __|| -__|| _| |___| |_____||__|__||_____||__|__||__||_____||_____||__| +---------------------------------------------------------------------+ | RTF::Tokenizer - Version 1.2 - Peter Sergeant - | +---------------------------------------------------------------------+ +-> Introduction +---------------------------------------------------------------------+ | | | RTF::Tokenizer is an object-orientated low-level RTF reader. If | | you're looking to render RTF, or want a higher-level RTF processor, | | this is not the module for you - you want RTF::Reader. This is the | | sixth release of RTF::Tokenizer - it's faster, higher quality, and | | implements the RTF standard better than any previous release. | | | | It's also philosophically a better module, and conforms more | | strictly to Object Orientated guidelines - it can be sub-classed | | and the interface is cleaner. | | | | And remember, if you do find a bug, you can make money for TPF, | | so visit http://grou.ch/rtf.html to find out more :-) | | | +---------------------------------------------------------------------+ +-> rtf2rtf +---------------------------------------------------------------------+ | | | Here's a bit of code that demonstrates almost all functionality | | and will hopefully give you a quick insight into how the module is | | used - full docs, are, of course, available in POD. | | | | #!/usr/bin/perl | | | | use strict; | | use RTF::Tokenizer; | | | | my $tokenizer = RTF::Tokenizer->new(); | | $tokenizer->read_file( $ARGV[0] ); | | | | while (1) { | | | | my ( $type, $argument, $param ) = $tokenizer->get_token(); | | | | last if $type eq 'eof'; | | | | print $argument if $type eq 'text'; | | print "\\$argument$param\n" if $type eq 'control'; | | print '}' if ($type eq 'group') and !$argument; | | print '{' if ($type eq 'group') and $argument; | | | | } | | | +---------------------------------------------------------------------+ +-> Bugs/TODO +---------------------------------------------------------------------+ | | | * \uN support is potentially buggy, although that shouldn't end | | up actually affecting anyone. See the docs for more details. | | | +---------------------------------------------------------------------+ +---------------------------------------------------------------------+ | RTF::Tokenizer - Version 1.2 - Peter Sergeant - | +---------------------------------------------------------------------+