PDF::API2::NamedDestination(3pmUser Contributed Perl DocumentatioPDF::API2::NamedDestination(3pm)
NAME
PDF::API2::NamedDestination - Add named destinations (views) to a PDF
METHODS
new
$destination = PDF::API2::NamedDestination->new($pdf, ...);
Creates a new named destination object. If any additional arguments are present, they
will be passed to "destination()".
destination
$destination = $destination->destination($page, $location, @args);
A destination is a particular view of a PDF, consisting of a page object, the location of
the window on that page, and possible coordinate and zoom arguments.
# The XYZ location takes three arguments
my $dest1 = PDF::API2::NamedDestination->new($pdf);
$dest->destination($pdf->open_page(1), 'xyz' => ($x, $y, $zoom));
# The Fit location doesn't require any arguments
my $dest2 = PDF::API2::NamedDestination->new($pdf);
$dest->destination($pdf->open_page(2), 'fit');
The following locations are available:
o xyz ($left, $top, $zoom)
Display the page with the coordinates ($left, $top) positioned at the upper-left
corner of the window and the contents of the page magnified by the factor $zoom. An
"undef" value for any of the arguments specifies that the current value of that
argument shall be retained unchanged. A zoom factor of 0 has the same meaning as
"undef".
o fit
Display the page with its contents magnified just enough to fit the entire page within
the window both horizontally and vertically. If the required horizontal and vertical
magnification factors are different, use the smaller of the two, centering the page
within the window in the other dimension.
o fith ($top)
Display the page with the vertical coordinate $top positioned at the top edge of the
window and the contents of the page magnified just enough to fit the entire width of
the page within the window. An "undef" value for $top specifies that the current
value of that argument shall be retained unchanged.
o fitv ($left)
Display the page with the horizontal coordinate $left positioned at the left edge of
the window and the contents of the page magnified just enough to fit the entire height
of the page within the window. An "undef" value for $left specifies that the current
value of that argument shall be retained unchanged.
o fitr ($left, $bottom, $right, $top)
Display the page with its contents magnified just enough to fit the rectangle
specified by the coordinates $left, $bottom, $right, and $top entirely within the
window both horizontally and vertically. If the required horizontal and vertical
magnification factors are different, use the smaller of the two, centering the
rectangle within the window in the other dimension.
o fitb
Display the page with its contents magnified just enough to fit its bounding box
entirely within the window both horizontally and vertically. If the required
horizontal and vertical magnification factors are different, use the smaller of the
two, centering the bounding box within the window in the other dimension.
o fitbh ($top)
Display the page with the vertical coordinate $top positioned at the top edge of the
window and the contents of the page magnified just enough to fit the entire width of
its bounding box within the window. An "undef" value for $top specifies that the
current value of that argument shall be retained unchanged.
o fitbv ($left)
Display the page with the horizontal coordinate $left positioned at the left edge of
the window and the contents of the page magnified just enough to fit the entire height
of its bounding box within the window. An "undef" value for $left specifies that the
current value of that argument shall be retained unchanged.
goto
$destination = $destination->goto($page, $location, @args);
A go-to action changes the view to a specified destination (page, location, and
magnification factor).
Parameters are as described in "destination".
uri
$destination = $destination->uri($uri);
A URI action indicates that a URI -- typically a web page -- should be launched.
launch
$destination = $destination->launch($file);
A launch action runs an application or opens or prints a document.
$file contains the path to the application to be launched or the document to be opened or
printed.
pdf
$destination = $destination->pdf($file, $page_number, $location, @args);
Similar to "goto", but the destination is in a different PDF file located at $file.
$page_number is an integer rather than a page object, and the other parameters are as
described in "destination".
perl v5.32.1 2021-12-11 PDF::API2::NamedDestination(3pm)
Generated by $Id: phpMan.php,v 4.55 2007/09/05 04:42:51 chedong Exp $ Author: Che Dong
On Apache
Under GNU General Public License
2025-11-21 17:58 @216.73.216.164 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)