I need to enable the below security setting in the PDF. How to do this via scripting
If you create the security policy in advance you can do it using the encryptUsingPolicy method of the Document object.
I am new to acrobat script. I know only little bit indesign script
A good place to start learning it: Adobe - Acrobat Developer Center | Adobe Developer Connection
Retrieving data ...