PDF::Bu...F::Dict(3)
π PDF::Builder::Basic::PDF::Dict β the manual, but make it cute π
okay bestie, so this is PDF::Bu...F::Dict(3), aka the page for PDF::Builder::Basic::PDF::Dict β it's all about PDF Dictionaries and Streams π¦ and honestly? it's giving foundational. no cap.
it inherits from PDF::Builder::Basic::PDF::Objind, so if you know that one you already know the family vibe β¨
πΈ INSTANCE VARIABLES πΈ
so there are these special instance variables, and they're specifically here to look after streams and stuff. the lil quirk? every single one of them starts with a space π yes really. iconique behaviour. keep up.
' stream'β this one holds the stream contents for output πΎ' streamfile'β this one holds the stream contents in an external file instead of in memory. and no, it's not the same thing as a PDF file stream, don't get it twisted. the data lives in its unfiltered form here π§' streamloc'β if both' stream'and' streamfile'are empty, then this one tells you where in the source PDF the stream actually starts π
β¨ METHODS β¨
π new
$d = PDF::Builder::Basic::PDF->new()
creates a brand new instance of a dictionary, slay π
tho real talk β the usual practice is to call PDFDict() instead. so like, do that. iykyk.
π¦ type
$type = $d->type($type)
get/set the standard Type key π
and here's the cute part: you can pass it a text value, and it'll return one too β instead of a Name object. lowkey convenient.
π filter
@filters = $d->filter(@filters)
get/set one or more filters being used by the optional stream that's attached to the dictionary π (optional stream! if there is one. vibe check first.)
π
π outobjdeep
$d->outobjdeep($fh, $pdf)
outputs the contents of the dictionary into a PDF file πβ¨ heads up: this is a recursive call, so it's giving main character energy that calls itself.
it also outputs a stream if the dictionary has a stream element. and if that happens? this method will calculate the length of the stream and insert it into the stream's dictionary. periodt. π
π read_stream
$d->read_stream($force_memory)
reads in a stream from a PDF file π₯
here's the tea tho: if the stream is greater than "PDF::Dict::mincache" (which defaults to 32768) bytes to be stored, then the default action is to create a file for it somewhere and use that file as a data cache ποΈ
but if $force_memory is set, that caching will not occur, and the data will all be stored in the $self->{' stream'} variable instead π§ π₯
π val
$d->val()
returns the dictionary. which is... itself πͺ the dictionary returns itself. self-love, honestly. we stan. πΈ
that's the whole page bestie, you ate it π this was PDF::Bu...F::Dict(3) from the User Contributed Perl Documentation, generated for perl v5.42.0 and dated 2026-01-17 π go forth and dictionary responsibly π«Άβ¨
π¦ where this page comes from
- fedora 44: perl-PDF-Builder 3.028-2.fc44 Β· LGPL-2.1-or-later AND LGPL-2.1-only AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms