Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Anyone know how to add a Hyperlink with PDF::API2

by flexvault (Prior)
on Dec 17, 2013 at 21:47 UTC ( #1067537=perlquestion: print w/ replies, xml ) Need Help??
flexvault has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I use 'PDF::API2' to generate pdf reports and I now need to add a hyperlink to get a pdf document within one of the reports. I tried this:

$pdf->link( 'http://search.cpan.org', 'A Hyperlink', x => 350, y => $pdf->height - 150 );

I took this format from 'PDF::API2::Simple;' which I get errors trying to install from CPAN. Can it be done with 'PDF::API2' directly?

Thank you...Ed

"Well done is better than well said." - Benjamin Franklin

Comment on Anyone know how to add a Hyperlink with PDF::API2
Download Code
Replies are listed 'Best First'.
Re: Anyone know how to add a Hyperlink with PDF::API2
by soonix (Vicar) on Dec 18, 2013 at 10:39 UTC

    Since PDF::API2::Simple is just a wrapper around PDF::API2, the answer has to be yes.

    But originally you wanted to use PDF::API2::Simple. I, too, tried to install it from CPAN, and also got an error. I don't know what your error was, mine was
    Can't locate inc/Module/Install.pm in @INC

    After I installed Module::Install from CPAN (seems to be a missing dependency), and changing one of the tests (Windows can't unlink open files, bug is older than my youngest son), I was able to install it. Perhaps with this info, you should be able to install it, too.

    Update: I'm a bit puzzled. The aforementioned bug is filed against PDF::API2::Simple, which uses ->saveas from PDF::API2 which in turn should close the file. Maybe an upstream bug?

      The Module::Install module should have been included in the P::A::S distribution in the inc directory, but it is not. File this as a bug against P::A::S (Update: unless already submitted - see below).

      --MidLifeXis

        There is already a bug "missing inc directory", which contains the aforementioned error message.

        next update: I just noticed there is an "unauthorized release" 1.1.5 by chromatic.
        I am behind a firewall and therefore using a "Minicpan" which is obviously outdated.
        Will try to check with actual CPAN and get back with the result later.

        cpan CHROMATIC/PDF-API2-Simple-1.1.5.tar.gz
        on a fresh strawberry didn't have the Module::Install missing (I added that info to rt://28125).
        rt://58106 still needs attention, but might be a problem in PDF::API2

      Dear soonix,

        Perhaps with this info, you should be able to install it, too.
      Thanks! You hit it right on ++ !

      Regards...Ed

      "Well done is better than well said." - Benjamin Franklin

Re: Anyone know how to add a Hyperlink with PDF::API2
by ww (Bishop) on Dec 18, 2013 at 03:13 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1067537]
Approved by taint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2015-07-30 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls