.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .\" ======================================================================== .\" .IX Title "PDF::API2::Basic::PDF::Filter 3" .TH PDF::API2::Basic::PDF::Filter 3 2023-12-21 "perl v5.38.1" "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 PDF::API2::Basic::PDF::Filter \- Abstract superclass for PDF stream filters .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& $f = PDF::API2::Basic::PDF::Filter\->new; \& $str = $f\->outfilt($str, 1); \& print OUTFILE $str; \& \& while (read(INFILE, $dat, 4096)) \& { $store .= $f\->infilt($dat, 0); } \& $store .= $f\->infilt("", 1); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" A Filter object contains state information for the process of outputting and inputting data through the filter. The precise state information stored is up to the particular filter and may range from nothing to whole objects created and destroyed. .PP Each filter stores different state information for input and output and thus may handle one input filtering process and one output filtering process at the same time. .SH METHODS .IX Header "METHODS" .SS PDF::API2::Basic::PDF::Filter\->new .IX Subsection "PDF::API2::Basic::PDF::Filter->new" Creates a new filter object with empty state information ready for processing data both input and output. .ie n .SS "$dat = $f\->infilt($str, $isend)" .el .SS "\f(CW$dat\fP = \f(CW$f\fP\->infilt($str, \f(CW$isend\fP)" .IX Subsection "$dat = $f->infilt($str, $isend)" Filters from output to input the data. Notice that \f(CW$isend\fR == 0 implies that there is more data to come and so following it \f(CW$f\fR may contain state information (usually due to the break-off point of \f(CW$str\fR not being tidy). Subsequent calls will incorporate this stored state information. .PP \&\f(CW$isend\fR == 1 implies that there is no more data to follow. The final state of \f(CW$f\fR will be that the state information is empty. Error messages are most likely to occur here since if there is required state information to be stored following this data, then that would imply an error in the data. .ie n .SS "$str = $f\->outfilt($dat, $isend)" .el .SS "\f(CW$str\fP = \f(CW$f\fP\->outfilt($dat, \f(CW$isend\fP)" .IX Subsection "$str = $f->outfilt($dat, $isend)" Filter stored data ready for output. Parallels \f(CW\*(C`infilt\*(C'\fR.