PDF::AP...DF::Name(3)

✨ NAME ✨

PDF::API2::Basic::PDF::Name β€” the low-level PDF name object, bestie πŸ’…

Like, it's the little guy that handles PDF names at the bare-metal level. Nothing fancy, just vibes and correct escaping. πŸŽ€


🌸 METHODS 🌸

πŸ’– PDF::API2::Basic::PDF::Name->from_pdf($string)

Okay so this one takes a given string and creates a brand-new string object out of it β€” and heads up, it's not a full object yet, it's just the string-object era of its life, okay? πŸ™ˆ

The string gets parsed according to the input criteria, and escaping works, in the way that's particular to Names. ✨


πŸ’œ $n->convert ($string, $pdf)

Converts a name into a string πŸ¦‹ β€” it strips the / and converts any hex munging. That's the whole job. Slay.


πŸ‘‘ $s->as_pdf ($pdf)

Returns a name formatted as PDF πŸ’…

$pdf is optional, but if you do supply it, it should be the PDF File object that this name is intended for. No cap.


🌈 PDF::API2::Basic::PDF::Name->string_to_name ($string, $pdf)

Suitably encodes the string $string for output in the File object $pdf. 🫢

And yes, the exact format may depend on the version of $pdf β€” iykyk.


🧚 PDF::API2::Basic::PDF::Name->name_to_string ($string, $pdf)

Suitably decodes the string $string as read from the File object $pdf. πŸ’–

Same deal: the exact decoding may depend on the version of $pdf. Principally, this is the one that undoes the hex encoding for PDF versions > 1.1. Periodt.


πŸ’€ Not me having to remind you that the decoding depends on the $pdf version β€” it literally says so twice, bestie. Read the whole thing, I'm begging. 😭

perl v5.42.0 πŸ“ 2025-09-01 🌸 and it's part of the User Contributed Perl Documentation crew β€” bye bestie, go forth and name things correctly πŸ’…βœ¨

πŸ“¦ where this page comes from
  • fedora 43: perl-PDF-API2 2.048-1.fc43 Β· LGPL-2.1-or-later AND (GPL-1.0-or-later OR Artistic-1.0-Perl) AND (MIT OR Artistic-1.0-Perl)
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms