Text::...:Filter(3pm)

๐Ÿ“ฆ
version 0.31 ยท 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

๐Ÿ’– NAME ๐Ÿ’–

okay bestie, gather round, because this one's a whole family of filter objects for PDF streams โœจ

  • PDF::Filter โ€” the abstract superclass for PDF stream filters. it's giving "blueprint energy", no cap.

๐ŸŒธ SYNOPSIS ๐ŸŒธ

$f = Text::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, literally the entire vibe of using one of these ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so a Filter object is basically holding onto state information for two things at once: outputting data through the filter, and inputting data through the filter. and what state exactly? honestly bestie that's up to the particular filter โ€” it ranges from nothing at all to whole objects getting created and destroyed ๐Ÿ˜ญ

each filter stores different state information for input versus output, which means one filter object can juggle one input filtering process and one output filtering process at the same time. multitasking queen ๐Ÿ‘‘


โญ METHODS โญ

๐ŸŽ€ Text::PDF::Filter->new

creates a shiny new filter object with empty state information, ready to process data both input and output. fresh start, blank slate, main character energy ๐ŸŒˆ

๐Ÿ’œ $dat = $f->infilt($str, $isend)

filters from output to input the data. okay here's the tea: $isend == 0 implies there's more data to come, and so following it, $f may contain state information (usually because the break-off point of $str wasn't tidy โ€” it's giving unhinged cliffhanger). subsequent calls will incorporate this stored state information, so it all gets stitched back together ๐Ÿงต

$isend == 1 implies there is no more data to follow. the final state of $f will be that the state information is empty. and bestie, this is where error messages are most likely to occur โ€” because if there's required state information to be stored following this data, that would imply an error in the data ๐Ÿ˜ญ๐Ÿ’€

๐Ÿซถ $str = $f->outfilt($dat, $isend)

filter stored data ready for output. it literally parallels infilt. twins fr fr ๐Ÿ’–


๐Ÿ‘‘ NAME ๐Ÿ‘‘

  • Text::PDF::ASCII85Decode โ€” Ascii85 filter for PDF streams. inherits from Text::PDF::Filter ๐ŸŒŠ

๐Ÿ“ NAME ๐Ÿ“

  • Text::PDF::RunLengthDecode โ€” Run Length encoding filter for PDF streams. inherits from Text::PDF::Filter ๐ŸŒ€

๐ŸŒŸ NAME ๐ŸŒŸ

  • Text::PDF::ASCIIHexDecode โ€” Ascii Hex encoding (very inefficient, okay, we said it ๐Ÿ™ˆ) for PDF streams. inherits from Text::PDF::Filter ๐Ÿงฎ

psst โ€” this page lives under the User Contributed Perl Documentation manual, and it's the one filed as Text::...:Filter(3pm). iykyk ๐Ÿ’…

anyway that's the whole page, slay, go filter some streams, periodt ๐ŸŽ€โœจ

perl v5.36.0 โ€” 2022-10-22 โ€” Text::...:Filter(3pm), mwah ๐Ÿ’‹

๐Ÿ“ฆ where this page comes from