Could someone explain how to use Document.EncryptAs() in more detail?
Here is the method signature:
public boolean EncryptAs( String dst, String upswd, String opswd, int perm, int method, byte[] id )
And here is the parameter list from the Javadoc:
dst - path to save, same as path parameter of SaveAs.
upswd - user password, can be null.
opswd - owner password, can be null.
perm - permission to set, same as GetPermission() method.
bit 1-2 reserved
bit 3(0x4) print
bit 4(0x8) modify
bit 5(0x10) extract text or image
others: see PDF reference
method - reserved, currently only AES with V=4 and R=4 mode can be working.
id - must be 32 bytes for file ID. it is divided to 2 array in native library, as each 16 bytes.
Here are my main questions:
1. What is the difference between upswd and opswd? Should they be the same? Which one is used when opening the PDF?
2. What should be passed into "permission" for a standard PDF? Can you give examples?
3. What should be passed into "method"? Can you give examples?
4. What should be passed into "id"? Can you give examples? What is it used for? How will it appear in the PDF?
Thanks,
Andrew