perl - pdf file encryption function error -


for testing encryption function (by default 128 bit encryption) , created pdf file 'apps.pdf' password protected 'abcd' password.

source code 1:

use pdf::tk; $doc = pdf::tk->new( pdftk => '/apps/free/pdftk/1.44/bin/pdftk' ); $doc->call_pdftk( 'apps.pdf', '1.128.pdf', 'owner_pw', 'abcd' ); 

getting error:

error: unexpected command-line data:      owner_pw  expecting input pdf filename,  operation (e.g. "cat") or "input_pw". exiting.  errors encountered. no output created.  done. input errors, no output created.  pdftk apps.pdf owner_pw abcd 1.128.pdf failed: 256 @ /usr/lib/perl5/site_perl/5.10.0/pdf/tk.pm         line 73. 

note: created new pdf 'apps.pdf' document open password 'abcd' , permission password 'abcd123'. please let me know how resolve it.

replace line "$doc->call_pdftk( 'apps.pdf', '1.128.pdf', 'owner_pw', 'abcd' );" command lines system('/apps/free/pdftk/1.44/bin/pdftk', 'apps.pdf', 'output', '1.128.pdf', 'owner_pw', 'abcd', 'user_pw', 'oct1234');

"owner_pw" contains permission password , "user_pw" contain open document password.

result : 1.128.pdf created security passwords.


Comments

Post a Comment

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -