Help / WLanguage / WLanguage functions / Standard functions / PDF functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
PDFPassword (Function)
In french: PDFMotDePasse
Protects and encrypts a PDF document with a password. A new encrypted PDF document with the specified password is created. This password will be requested when the PDF file is opened.
IF NOT PDFPassword("clear.pdf", "encrypt.pdf", iProtectionDefault, "password") THEN
<Result> = PDFPassword(<Source PDF file> , <Result PDF file> , <Options> , <Password> [, <Protection password>])
<Result>: Boolean
  • True if the protection is applied,
  • False if a problem occurs. ErrorInfo returns the details of the error.
<Source PDF file>: Character string
Name and full path of the PDF file to protect.
Remark: This PDF file must not already be password-protected.
<Result PDF file>: Character string
Name and full path of the protected PDF file.
<Options>: Integer constant (or combination of constants)
Available protection options:
iProtectionCommentRestricts adding or editing comments.
iProtectionDefaultDefault protection: the PDF file is only encrypted with a password (without any additional protection).
iProtectionModificationThe content of the PDF file cannot be modified.
iProtectionPrintingThe PDF file cannot be printed.
iProtectionSelectionThe content of the PDF file cannot be copied or extracted from the file.
<Password>: Character string
Password used to open the PDF file. This password allows you to decrypt the PDF file to read it while respecting the permissions set in the <Options> parameter.
This password cannot contain Unicode characters.
<Protection password>: Optional character string
Password used to change the protection options of the PDF file. If this password is used, the protection options specified in the <Options> parameters will not be taken into account.
This password cannot contain Unicode characters.
Business / UI classification: Business Logic
Component: wd290wdpdf.dll
Minimum version required
  • Version 24
This page is also available for…
Click [Add] to post a comment

Last update: 04/17/2024

Send a report | Local help