Encrypt the pdf

I am encrypting the pdf in rails using pdf-toolkit

here is my code:
PDF::Toolkit.pdftk(infile output outfile user_pw rails)

It is giving error saying that
undefined method user_pw

Any suggestions

On 5 December 2012 10:40, kiran cy [email protected] wrote:

I am encrypting the pdf in rails using pdf-toolkit

here is my code:
PDF::Toolkit.pdftk(infile output outfile user_pw rails)

It is giving error saying that
undefined method user_pw

Have you provided that method or variable? If not then what do you
think that user_pw is referring to?

Colin

I think that is predefined in pdftk

On 5 December 2012 11:04, kiran cy [email protected] wrote:

Please quote the previous message and put your reply inline at
appropriate points. Remember this is a mailing list not a forum
(though you may be accessing it via a forum-like interface. Thanks.

I think that is predefined in pdftk

Can you point me to the docs that make you think that in

PDF::Toolkit.pdftk(infile output outfile user_pw rails)

that user_pw is predefined in pdftk?

Colin

Colin L. wrote in post #1087900:

On 5 December 2012 11:04, kiran cy [email protected] wrote:

Please quote the previous message and put your reply inline at
appropriate points. Remember this is a mailing list not a forum
(though you may be accessing it via a forum-like interface. Thanks.

I think that is predefined in pdftk

Can you point me to the docs that make you think that in

PDF::Toolkit.pdftk(infile output outfile user_pw rails)

that user_pw is predefined in pdftk?

Colin

On Dec 5, 11:14am, kiran cy [email protected] wrote:

PDFtk Server Examples

That is the usage summary for the command line tools, not for the ruby
api. For starters you’ll need to separate your arguments with commas,
not spaces

Fred

On 5 December 2012 11:14, kiran cy [email protected] wrote:

PDF::Toolkit.pdftk(infile output outfile user_pw rails)

that user_pw is predefined in pdftk?

Colin

PDFtk Server Examples

As you have coded it ruby will look for a variable or method called
user_pw from which to get the value to pass to pdftk. If you want to
pass the string user_pw then I guess that you must put “user_pw”.

Colin

It is working pdf is encrypted

my_pdf =
PDF::Toolkit.open(directory+@encrypt_pdf.attach.url.split(’?’)[0].to_s)
my_pdf.user_password=@encrypt_pdf.user_password
my_pdf.owner_password=@encrypt_pdf.owner_password

how to allow permissions like printing screen reader