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