logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PDF::Builder::NamedDestination - Add named destinations (views) to a PDF

Contents

Methods

new
           $dest = PDF::Builder::NamedDestination->new($pdf, ...)

           Creates a new named destination object. Any optional additional arguments will be passed on to
           "destination".

   Destinationtypesdest

           $dest->dest($page, %opts)

           A destination (dest) 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::Builder::NamedDestination->new($pdf);
               $dest->dest($pdf->open_page(1), 'xyz' => [$x, $y, $zoom]);

               # The Fit location doesn't require any arguments, but one is still
               # needed for the hash array
               my $dest2 = PDF::Builder::NamedDestination->new($pdf);
               $dest->dest($pdf->open_page(2), 'fit' => 1);

           See "Page Fit Options" in PDF::Builder::Docs for a listing of the available locations and their
           syntax.

           "xyz" is the default fit setting, with position (left and top) and zoom the same as the calling
           page's.

   TargetDestinationslink,goto

           $dest->link($page, %opts)

           A go-to (link) action changes the view to a specified destination (page, location, and magnification
           factor).

           Parameters are as described in "dest".

           Alternatename: "goto"

           Originally this method was "link", but recently PDF::API2 changed the name to "goto". "goto" is added
           for compatibility.

       uri,url

           $dest->uri($url)

           Defines the destination as launch-url with uri $url.

           Alternatename: "url"

           Originally this method was "url", but recently PDF::API2 changed the name to "uri". "url" is retained
           for compatibility.

       launch,file

           $dest->launch($file)

           Defines the destination as launch-file with filepath $file and page-fit options %opts. The target
           application is run. Note that this is not a PDF or a browser file -- it is a local application.

           Alternatename: "file"

           Originally this method was "file", but recently PDF::API2 changed the name to "launch". "file" is
           retained for compatibility.

       pdf,pdf_file,pdfile

           $dest->pdf($pdf_file, $pagenum, %opts)

           Defines the destination as a PDF-file with filepath $pdf_file, on page $pagenum, and options %opts
           (same as dest()).

           Alternatenames: "pdf_file" and "pdfile"

           Originally this method was "pdfile", and had been earlier renamed to "pdf_file", but recently
           PDF::API2 changed the name to "pdf". "pdfile" and "pdf_file" are retained for compatibility. Notethat the position and zoom information is still given as a hash element in PDF::Builder, while
           PDF::API2 has changed to a position string and an array of dimensions.

perl v5.40.1                                       2025-08-10                PDF::Builder::NamedDestination(3pm)

Name

       PDF::Builder::NamedDestination - Add named destinations (views) to a PDF

       Inherits from PDF::Builder::Basic::PDF::Dict

See Also