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