summaryrefslogtreecommitdiff
path: root/lib/PDF/Builder/Basic/PDF/Name.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PDF/Builder/Basic/PDF/Name.pm')
-rw-r--r--lib/PDF/Builder/Basic/PDF/Name.pm50
1 files changed, 37 insertions, 13 deletions
diff --git a/lib/PDF/Builder/Basic/PDF/Name.pm b/lib/PDF/Builder/Basic/PDF/Name.pm
index fe1b94b..5402a71 100644
--- a/lib/PDF/Builder/Basic/PDF/Name.pm
+++ b/lib/PDF/Builder/Basic/PDF/Name.pm
@@ -20,8 +20,8 @@ use base 'PDF::Builder::Basic::PDF::String';
use strict;
use warnings;
-our $VERSION = '3.025'; # VERSION
-our $LAST_UPDATE = '3.024'; # manually update whenever code is changed
+our $VERSION = '3.026'; # VERSION
+our $LAST_UPDATE = '3.026'; # manually update whenever code is changed
=head1 NAME
@@ -30,14 +30,18 @@ and stores PDF names (things beginning with /)
=head1 METHODS
-=over
+=head2 from_pdf
+
+ $n = PDF::Builder::Basic::PDF::Name->from_pdf($string)
-=item $n = PDF::Builder::Basic::PDF::Name->from_pdf($string)
+=over
Creates a new string object (not a full object yet) from a given
-string. The string is parsed according to input criteria with
+string. The string is parsed according to input criteria with
escaping working, particular to Names.
+=back
+
=cut
sub from_pdf {
@@ -49,11 +53,17 @@ sub from_pdf {
return $self;
}
-=item $n->convert($string, $pdf)
+=head2 convert
+
+ $n->convert($string, $pdf)
+
+=over
Converts a name into a string by removing the / and converting any hex
munging.
+=back
+
=cut
sub convert {
@@ -63,11 +73,17 @@ sub convert {
return $string;
}
-=item $s->as_pdf($pdf)
+=head2 as_pdf
+
+ $s->as_pdf($pdf)
+
+=over
Returns a name formatted as PDF. C<$pdf> is optional but should be the
PDF File object for which the name is intended if supplied.
+=back
+
=cut
sub as_pdf {
@@ -84,11 +100,17 @@ sub as_pdf {
# spaces were implicitly allowed in names as well but it would be best
# to ignore that (PDF 1.3, section H.3.2.4.3).
-=item PDF::Builder::Basic::PDF::Name->string_to_name($string, $pdf)
+=head2 string_to_name
+
+ PDF::Builder::Basic::PDF::Name->string_to_name($string, $pdf)
+
+=over
Suitably encode the string C<$string> for output in the File object C<$pdf>
(the exact format may depend on the version of $pdf).
+=back
+
=cut
sub string_to_name {
@@ -102,12 +124,18 @@ sub string_to_name {
return $string;
}
-=item PDF::Builder::Basic::PDF::Name->name_to_string($string, $pdf)
+=head2 name_to_string
+
+ PDF::Builder::Basic::PDF::Name->name_to_string($string, $pdf)
+
+=over
Suitably decode the string C<$string> as read from the File object C<$pdf>
(the exact decoding may depend on the version of $pdf). Principally,
undo the hex encoding for PDF versions > 1.1.
+=back
+
=cut
sub name_to_string {
@@ -123,8 +151,4 @@ sub name_to_string {
return $string;
}
-=back
-
-=cut
-
1;