Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

setPasswords()


Sets passwords for PDF and Word document protection.

PDF syntax:

Code Block
setPasswords(tcOwnerPassword, tcUserPassword)

Parameters:

The user password (tcUserPassword) can be empty. If the owner password (tcOwnerPassword) is empty, a random string will be generated as the password. 
The owner can do anything with the document. The user permissions can be set using the setPermissions() methods.

Word syntax:

Code Block
setPasswords(tcReadPassword, tcWritePassword, tlRequirePassword)

You can omit either tcReadPassword or tcWritePassword. tlRequirePassword is optional (default value is .F.). If set to .T., Word will ask for the password even when the document is being opened first time after the generation (if DoNotOpenViewer property is set to .F.).

setPermissions()



Sets the user permissions in the PDF document.

Syntax:

Code Block
setPermissions(tlPrintDocument, tlModifyDocument, tlCopyTextAndGraphics, tlAddOrModifyAnnotations)



Table of Contents