.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Mail::SpamAssassin::PDF::Parser 3pm" .TH Mail::SpamAssassin::PDF::Parser 3pm 2026-11-05 "perl v5.42.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Mail::SpamAssassin::PDF::Parser \- Parse PDF documents .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 7 \& use Mail::SpamAssassin::PDF::Parser; \& my $parser = Mail::SpamAssassin::PDF::Parser\->new(timeout => 5); \& $parser\->parse(\e$data); \& print $parser\->version(); \& print $parser\->info()\->{Author}; \& print $parser\->is_encrypted(); \& print $parser\->is_protected(); .Ve .IP new(%opts) 4 .IX Item "new(%opts)" Create a new parser object. Options are: .RS 4 .IP context 4 .IX Item "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. .IP timeout 4 .IX Item "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. .IP max_bytes 4 .IX Item "max_bytes" Most bytes of stream data to decode. The output of each decoding filter, and each reuse of a decoded stream, counts towards it; \fBparse()\fR dies, and \&\fBextract_images()\fR skips the image, once the total is over it. \fBbytes_decoded()\fR returns the total. Unlimited if not given. .IP debug 4 .IX Item "debug" Set the debugging level. Valid values are \*(Aqall\*(Aq, \*(Aqtrace\*(Aq, \*(Aqxref\*(Aq, \*(Aqstream\*(Aq, \&\*(Aqtokens\*(Aq, \*(Aqpage\*(Aq, \*(Aqimage\*(Aq, \*(Aqtext\*(Aq, \*(Aquri\*(Aq .RE .RS 4 .RE .IP parse($data) 4 .IX Item "parse($data)" Parse a PDF document. \f(CW$data\fR can be a filename, a reference to a scalar containing the PDF data, or a file handle.