ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / PDF functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
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.
Example
IF NOT PDFPassword("clear.pdf", "encrypt.pdf", iProtectionDefault, "password") THEN
	Error(ErrorInfo())
END
Syntax
<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.
Note: 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:
New in SaaS
iProtectionAssemble
Restricts PDF file assembly.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
iProtectionCommentRestricts adding or editing comments.
New in SaaS
iProtectionCopyAccessibility
Restricts copying content for accessibility purposes.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
New in SaaS
iProtectionFillForm
Form fields in the PDF file will not support user input.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
iProtectionModificationThe content of the PDF file cannot be modified.
iProtectionNoneNo protection for the PDF file.
iProtectionPrintingThe PDF file cannot be printed.
iProtectionSelectionThe content of the PDF file cannot be copied or extracted from the file.
<Password>: Character string or Secret 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.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
<Protection password>: Optional string or Secret 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.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
Business / UI classification: Business Logic
Component: wd300wdpdf.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/11/2025

Send a report | Local help