Scroll to navigation

Mail::SpamAssassin::PDF::Parser(3pm) User Contributed Perl Documentation Mail::SpamAssassin::PDF::Parser(3pm)

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();
Create a new parser object. Options are:
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 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.
Most bytes of stream data to decode. The output of each decoding filter, and each reuse of a decoded stream, counts towards it; parse() dies, and extract_images() skips the image, once the total is over it. bytes_decoded() returns the total. Unlimited if not given.
Set the debugging level. Valid values are 'all', 'trace', 'xref', 'stream', 'tokens', 'page', 'image', 'text', 'uri'
Parse a PDF document. $data can be a filename, a reference to a scalar containing the PDF data, or a file handle.
2026-11-05 perl v5.42.3