Text::PDF::Name(3pm)

πŸ“¦
version 0.31 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Text::PDF::Name β€” okay so picture a class that inherits from Text::PDF::String and its entire job is storing PDF names, aka the things that start with a slash /. That's it. That's the whole vibe. Slash girlies rise πŸ’…


✨ METHODS ✨

🫢 Text::PDF::Name->from_pdf($string)

Makes you a shiny new string object from a string you hand it β€” and bestie, clock this: it's not a full object yet, it's just the string part, okay? The string gets parsed according to input criteria, and escaping works, in the specific way that Names need. No cap. ✨

πŸŽ€ $n->convert ($str, $pdf)

Glow-up moment: this takes a name and turns it into a string by removing the / and undoing any hex munging β€” unless you pass in $pdf and its version is less than 1.2. Pass that old version and nope, the conversion just doesn't happen. Sorry bestie. πŸ™ˆ

🌸 $s->as_pdf ($pdf)

Gives the name back to you formatted as actual PDF. $pdf is optional, lowkey, but if you do supply it, it should be the PDF File object that this name is intended for. Be nice to it. 🫢

πŸ¦‹ Text::PDF::Name->string_to_name ($str, $pdf)

Encodes the string $str suitably for output in the File object $pdf (and fr fr, the exact format may depend on the version of $pdf). Prinicipally: certain characters get hex-encoded if the version is greater than 1.1. πŸ”₯

πŸ’œ Text::PDF::Name->name_to_string ($str, $pdf)

The reverse queen πŸ‘‘ β€” this suitably decodes the string $str as read from the File object $pdf (same deal, the exact decoding may depend on the version of $pdf). Principally: it undoes that hex encoding for PDF versions > 1.1. Undoing encoding is self-care, periodt.


vibe check passed β€” this page came from the User Contributed Perl Documentation, and it's living its best life as perl v5.36.0, dated 2022-10-22. Bestie, that's a whole retro moment. Stay iconic, go parse a name or something. πŸ’–πŸŽ€πŸ¦‹πŸŒˆ
πŸ“¦ where this page comes from