PDF::AP...::Filter(3)
β¨ PDF::API2::Basic::PDF::Filter π
okay bestie, welcome to PDF::AP...::Filter(3) β yes the manual name is literally truncated like that, that's just how the header rolls, don't @ me π
πΈ NAME πΈ
PDF::API2::Basic::PDF::Filter β the abstract superclass for PDF stream filters. it's giving blueprint energy: it doesn't do the work itself, it just defines the whole vibe that every actual filter inherits π
π¦ SYNOPSIS π¦
$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);
likeβ¦ this is the whole flow. make a filter, push data through it, pull data back out. iconic behavior fr fr π₯
π DESCRIPTION π
so a Filter object is literally just a lil container of state information for the process of outputting and inputting data through the filter. that's it. that's the job. β¨
the precise state information stored? honestly up to the particular filter. could range from nothing at all to whole objects created and destroyed. no cap, it's that open-ended. π
and here's the slay part: each filter stores different state information for input and output, so it can handle one input filtering process and one output filtering process at the same time. multitasking queen π
π§ METHODS π§
β PDF::API2::Basic::PDF::Filter->new
creates a brand new filter object with empty state information, all fresh and ready to process data in both directions β input and output. main character debut moment π
β $dat = $f->infilt($str, $isend)
filters the data from output to input. yes that's the direction, that's just how it is bestie π¦
notice this: $isend == 0 implies there's more data to come, so following it, $f may contain state information β usually because the break-off point of $str wasn't tidy π. subsequent calls will incorporate that stored state information. so like, it remembers where it was. memory queen π§ β¨
$isend == 1 implies there is no more data to follow. the final state of $f will be that the state information is empty. and ngl, error messages are most likely to occur here β because if there's required state information to be stored following this data, then that would imply an error in the data. π
lowkey the $isend == 1 call is the vibe check of the whole filter. if there's leftover state, something went wrong. periodt.
β $str = $f->outfilt($dat, $isend)
filters stored data ready for output. it parallels "infilt" β same energy, opposite direction π
and that's the whole page bestie!! now go filter some streams π
cute lil sign-off: this page is from perl v5.42.0, dated 2025-09-01, and it's part of the User Contributed Perl Documentation for PDF::AP...::Filter(3). mwah π«Ά
π¦ where this page comes from
- fedora 43: perl-PDF-API2 2.048-1.fc43 Β· LGPL-2.1-or-later AND (GPL-1.0-or-later OR Artistic-1.0-Perl) AND (MIT OR Artistic-1.0-Perl)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms