Text::PDF::Name(3pm)
π 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
- ubuntu noble: libtext-pdf-perl 0.31-3 Β· Artistic-2.0
- ubuntu resolute: libtext-pdf-perl 0.31-3 Β· Artistic-2.0
- ubuntu stonking: libtext-pdf-perl 0.31-3 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms