unlock(withPassword:)
Attempts to unlock an encrypted document.
Declaration
func unlock(withPassword password: String) -> BoolParameters
- password:
The password to unlock an encrypted document (you cannot lock an unlocked PDF document by using an incorrect password).
Return Value
true if the specified password unlocks the document, false otherwise.
Discussion
If the password is correct, this method returns true, and a PDFDocumentDidUnlockNotification notification is sent. Once unlocked, you cannot use this function to relock the document.
If you attempt to unlock an already unlocked document, one of the following occurs:
If the document is unlocked with full owner permissions,
unlockWithPassworddoes nothing and returns true. The password string is ignored.If the document is unlocked with only user permissions,
unlockWithPasswordattempts to obtain full owner permissions with the password string. If the string fails, the document maintains its user permissions. In either case, this method returns true.