PDF::Bu...:Filter(3)

๐Ÿ’– PDF::Builder::Basic::PDF::Filter โ€” the abstract superclass era โœจ

okay bestie so this is PDF::Builder::Basic::PDF::Filter, straight out of the User Contributed Perl Documentation section, and it's giving abstract superclass main character energy ๐ŸŽ€. It's the parent vibe for PDF stream filters, iykyk.


๐Ÿฆ‹ NAME

PDF::Builder::Basic::PDF::Filter โ€” the abstract superclass for PDF stream filters. it's the blueprint, the template, the mother of all filters, periodt ๐Ÿ’…


โœจ SYNOPSIS

$f = PDF::Builder::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);

look at that. chef's kiss. ๐ŸคŒ


๐ŸŒธ DESCRIPTION

so a Filter object is literally just a little container holding state information for the whole process of outputting and inputting data through the filter. how much state? honestly depends on the filter โ€” it could be absolutely nothing, or it could be whole objects getting created and destroyed. no cap, the range is that wide. ๐Ÿ’€

and here's the cute part: every filter stores different state info for input vs output, which means one single filter can handle one input filtering process and one output filtering process at the same time. multitasking queen ๐Ÿ‘‘


๐Ÿ‘‘ METHODS

๐Ÿ’œ new

PDF::Builder::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. it's a clean slate, a blank canvas, a new semester. ๐Ÿซถ

๐Ÿ’œ infilt

$dat = $f->infilt($str, $isend)

this one filters from output to input the data. ๐ŸŒ€

now listen closely because this matters:

  • $isend == 0 means there is more data to come, so after this call $f may still be holding onto state information โ€” usually because the break-off point of $str wasn't tidy. subsequent calls will pick up and incorporate that stored state. it's like saving your game mid-level ๐ŸŽฎ
  • $isend == 1 means there is no more data to follow. the final state of $f will be that the state information is empty. and ngl, this is where error messages are most likely to pop off โ€” because if there's still required state information that needs storing after this data, that would imply an error in the data. ๐Ÿšจ
bestie. if you hit an error here, the data itself is sus. not you, the data.

๐Ÿ’œ outfilt

$str = $f->outfilt($dat, $isend)

filters stored data so it's ready for output. it parallels infilt โ€” same energy, opposite direction. ๐ŸŒˆ


๐ŸŒŸ sign-off

and that's the whole page, bestie!! ๐Ÿ’– this was pulled from perl v5.42.0, dated 2026-01-17 โ€” iconic, timeless, and forever in the PDF::Bu...:Filter(3) hall of fame. go forth and filter responsibly. โœจ๐Ÿฆ‹๐ŸŽ€

๐Ÿ“ฆ where this page comes from