{
    "mode": "perldoc",
    "parameter": "PDF::API2::NamedDestination",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/PDF%3A%3AAPI2%3A%3ANamedDestination/json",
    "generated": "2026-10-07T22:38:45Z",
    "sections": {
        "NAME": {
            "content": "PDF::API2::NamedDestination - Add named destinations (views) to a PDF\n",
            "subsections": []
        },
        "METHODS": {
            "content": "new\n$destination = PDF::API2::NamedDestination->new($pdf, ...);\n\nCreates a new named destination object. If any additional arguments are present, they will be\npassed to destination().\n\ndestination\n$destination = $destination->destination($page, $location, @args);\n\nA destination is a particular view of a PDF, consisting of a page object, the location of the\nwindow on that page, and possible coordinate and zoom arguments.\n\n# The XYZ location takes three arguments\nmy $dest1 = PDF::API2::NamedDestination->new($pdf);\n$dest->destination($pdf->openpage(1), 'xyz' => ($x, $y, $zoom));\n\n# The Fit location doesn't require any arguments\nmy $dest2 = PDF::API2::NamedDestination->new($pdf);\n$dest->destination($pdf->openpage(2), 'fit');\n\nThe following locations are available:\n\n*   xyz ($left, $top, $zoom)\n\nDisplay the page with the coordinates ($left, $top) positioned at the upper-left corner of\nthe window and the contents of the page magnified by the factor $zoom. An \"undef\" value for\nany of the arguments specifies that the current value of that argument shall be retained\nunchanged. A zoom factor of 0 has the same meaning as \"undef\".\n\n*   fit\n\nDisplay the page with its contents magnified just enough to fit the entire page within the\nwindow both horizontally and vertically. If the required horizontal and vertical\nmagnification factors are different, use the smaller of the two, centering the page within\nthe window in the other dimension.\n\n*   fith ($top)\n\nDisplay the page with the vertical coordinate $top positioned at the top edge of the window\nand the contents of the page magnified just enough to fit the entire width of the page\nwithin the window. An \"undef\" value for $top specifies that the current value of that\nargument shall be retained unchanged.\n\n*   fitv ($left)\n\nDisplay the page with the horizontal coordinate $left positioned at the left edge of the\nwindow and the contents of the page magnified just enough to fit the entire height of the\npage within the window. An \"undef\" value for $left specifies that the current value of that\nargument shall be retained unchanged.\n\n*   fitr ($left, $bottom, $right, $top)\n\nDisplay the page with its contents magnified just enough to fit the rectangle specified by\nthe coordinates $left, $bottom, $right, and $top entirely within the window both\nhorizontally and vertically. If the required horizontal and vertical magnification factors\nare different, use the smaller of the two, centering the rectangle within the window in the\nother dimension.\n\n*   fitb\n\nDisplay the page with its contents magnified just enough to fit its bounding box entirely\nwithin the window both horizontally and vertically. If the required horizontal and vertical\nmagnification factors are different, use the smaller of the two, centering the bounding box\nwithin the window in the other dimension.\n\n*   fitbh ($top)\n\nDisplay the page with the vertical coordinate $top positioned at the top edge of the window\nand the contents of the page magnified just enough to fit the entire width of its bounding\nbox within the window. An \"undef\" value for $top specifies that the current value of that\nargument shall be retained unchanged.\n\n*   fitbv ($left)\n\nDisplay the page with the horizontal coordinate $left positioned at the left edge of the\nwindow and the contents of the page magnified just enough to fit the entire height of its\nbounding box within the window. An \"undef\" value for $left specifies that the current value\nof that argument shall be retained unchanged.\n\ngoto\n$destination = $destination->goto($page, $location, @args);\n\nA go-to action changes the view to a specified destination (page, location, and magnification\nfactor).\n\nParameters are as described in \"destination\".\n\nuri\n$destination = $destination->uri($uri);\n\nA URI action indicates that a URI -- typically a web page -- should be launched.\n\nlaunch\n$destination = $destination->launch($file);\n\nA launch action runs an application or opens or prints a document.\n\n$file contains the path to the application to be launched or the document to be opened or\nprinted.\n\npdf\n$destination = $destination->pdf($file, $pagenumber, $location, @args);\n\nSimilar to \"goto\", but the destination is in a different PDF file located at $file. $pagenumber\nis an integer rather than a page object, and the other parameters are as described in\n\"destination\".\n",
            "subsections": []
        }
    },
    "summary": "PDF::API2::NamedDestination - Add named destinations (views) to a PDF",
    "flags": [],
    "examples": [],
    "see_also": []
}