sumalatha has asked for the wisdom of the Perl Monks concerning the following question:

i'am new to perl programming and tiring to implement a function to perform pdf file get encrypted and save in server and pdf encrypted file need to decrypted , when it is downloaded by a authorised user and for rest of the users if they download , it should be in unreadable format.

for implementing the above function, i tried of doing using pdftk and installed PDF::Tk ().

source code:
use PDF::Tk; my $doc=PDF::Tk->new(); $doc->call_pdftk('input.pdf', 'outPDF.pdf', 'owner_pw', 'foopass');
output: Can't find executablable /usr/bin/pdftk at /usr/lib/perl5/site_perl/5.8.5/PDF/Tk.pm line 19.

Does this error mean to set the environment PATH variable to "/usr/bin/pdftk".

Please let me know how to resolve the above issue.

Replies are listed 'Best First'.
Re: pdftk functionality
by NetWallah (Canon) on Aug 21, 2014 at 04:55 UTC
    It means that you need to download and install the pdftk binary from https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/, and make sure it installs at /usr/bin/pdftk.

            "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams

      CPAN Module "PDF::Tk" itself is a Perl integration for the pdf toolkit (pdftk). is it necessary to install pdftk binary from https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/.

        installed the pdftk binary file and the path to variable and tried running , getting error as below: Error: "pdftk input.pdf owner_pw foopass outPDF.pdf failed: -1 at /usr/lib/perl5/site_perl/5.10.0/PDF/Tk.pm line 73."

        use PDF::Tk; my $doc=PDF::Tk->new(pdftk=>'/apps/free/pdftk/'); $doc->call_pdftk('input.pdf', 'outPDF.pdf', 'owner_pw', 'foopass');

        please guide me in resolving it