NAME

Mail::SpamAssassin::PDF::Parser - Parse PDF documents

SYNOPSIS

use Mail::SpamAssassin::PDF::Parser;
my $parser = Mail::SpamAssassin::PDF::Parser->new(timeout => 5);
$parser->parse(\$data);
print $parser->version();
print $parser->info()->{Author};
print $parser->is_encrypted();
print $parser->is_protected();
new(%opts)

Create a new parser object. Options are:

context

A Mail::SpamAssassin::PDF::Context object. This object will be used to handle callbacks for various PDF objects. See Mail::SpamAssassin::PDF::Context for more information.

timeout

Timeout in seconds. If the PDF document takes longer than this to parse, the parser will die with an error. This is useful for preventing denial of service attacks.

debug

Set the debugging level. Valid values are 'all', 'trace', 'xref', 'stream', 'tokens', 'page', 'image', 'text', 'uri'

parse($data)

Parse a PDF document. $data can be a filename, a reference to a scalar containing the PDF data, or a file handle.