PDF::Bu...F::Name(3)
π PDF::Builder::Basic::PDF::Name β bestie edition β¨
okay so real quick, this is a Perl module that stores PDF names. you know, the things that start with a /? yeah. those. slay.
it inherits from PDF::Builder::Basic::PDF::String β family tree matters, periodt π
π METHODS π
πΈ from_pdf
$n = PDF::Builder::Basic::PDF::Name->from_pdf($string)
this one makes a brand new string object from a given string β and ngl, it's not a full object yet, just the string part. it parses that string using the input criteria, with escaping doing its thing, in the way that's particular to Names specifically. iykyk π
π¦ convert
$n->convert($string, $pdf)
turns a name into a string. the way that it does this: it strips the / off and undoes any hex munging. literally that simple. iconic behavior honestly π«Ά
β¨ as_pdf
$s->as_pdf($pdf)
hands you back a name formatted the way PDF wants it. $pdf is optional, but if you do pass it, it should be the PDF File object that this name is meant for. so like, be a good bestie and pass it if you have it π
π string_to_name
PDF::Builder::Basic::PDF::Name->string_to_name($string, $pdf)
encodes the string $string suitably for output in the File object $pdf. heads up though β the exact format may depend on the version of $pdf. so don't come for me if it looks different across versions, it's giving "version-dependent" and that's just the truth π₯
π name_to_string
PDF::Builder::Basic::PDF::Name->name_to_string($string, $pdf)
decodes the string $string suitably as read from the File object $pdf. same deal: the exact decoding may depend on the version of $pdf. and principally? it undoes the hex encoding for PDF versions > 1.1. that's the main character job here β
okay that's the whole page bestie, no notes π this gem was documented with perl v5.42.0 and dated 2026-01-17. go forth and encode ur names, ily ππΈπ¦
π¦ 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