deprecated_A3DPDFDocumentSetPassword

A3DStatus deprecated_A3DPDFDocumentSetPassword(A3DPDFDocument *pDoc, const A3DUTF8Char *pcUserPassword, const A3DUTF8Char *pcOwnerPassword)

deprecated

A3DStatus deprecated_A3DPDFDocumentSetPassword(A3DPDFDocument* pDoc, const A3DUTF8Char* pcUserPassword, const A3DUTF8Char* pcOwnerPassword)

Function to add user and owner passwords on a document.

DeprecatedThis function is deprecated because it allows generation of a PDF file with an owner password and no permissions, which is not a good practice. Use A3DPDFDocumentSetPasswordSecurity() instead. This will be removed in version 2026.1.0.

These passwords are natively supported by Adobe Reader. If a user password is specified, Adobe Reader will ask for a password when opening the document. The owner password is the password used to set document restrictions on the document. It does not restrict the opening of a PDF file, only what can be done once opened. Document restrictions can include printing, changing the document, document assembly, content copying, content copying for accessibility, page extraction, commenting, filling of form fields, signing, and creation of template pages.

Parameters

pDoc: The Document object to work with.

pcUserPassword: The password to protect the document at opening. Also protects against document modification and printing. If an empty string is specified, no user password is required by Adobe Reader or Acrobat.

pcOwnerPassword: Lets you require a password when changing the security features of the PDF, not when opening it. If an empty string is specified, no password will be required in Acrobat to change security settings.

Returns

A3D_SUCCESS in case of success or an error code