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