public HPDF_STATUS setPassword(
    string ownerPasswd, 
    string userPasswd = null)

Sets a password for the document. If the password is set, document contents are encrypted

Parameters

ownerPassword

The password for the owner of the document. The owner can change the permission of the document. null, zero length string, and the same value as user password are not allowed.

userPassword

The password for the user of the document. The userPassword may be set to null or zero length string.