Text::PDF::Name(3) User Contributed Perl Documentation Text::PDF::Name(3)

# [NAME](#NAME)

Text::PDF::Name - Inherits from Text::PDF::String and stores PDF names (things beginning with /)

# [METHODS](#METHODS)

## [Text::PDF::Name-&gt;from\_pdf($string)](#Text::PDF::Name)

Creates a new string object (not a full object yet) from a given string. The string is parsed according to input criteria with escaping working, particular to Names.

## [$n-&gt;convert ($str, $pdf)](#$n)

Converts a name into a string by removing the / and converting any hex munging unless $pdf is supplied and its version is less than 1.2.

## [$s-&gt;as\_pdf ($pdf)](#$s)

Returns a name formatted as PDF. $pdf is optional but should be the PDF File object for which the name is intended if supplied.

## Text::PDF::Name-&gt;string\_to\_name ($str, $pdf)

Suitably encode the string $str for output in the File object $pdf (the exact format may depend on the version of $pdf). Prinicipally, encode certain characters in hex if the version is greater than 1.1.

## Text::PDF::Name-&gt;name\_to\_string ($str, $pdf)

Suitably decode the string $str as read from the File object $pdf (the exact decoding may depend on the version of $pdf). Principally, undo the hex encoding for PDF versions &gt; 1.1.

2026-10-03 perl v5.44.0

---

Document: Text::PDF::Name(3pm) from perl-text-pdf 0.31-r0 (Chainguard OS)
