encryptPDF
Password protects a stored PDF file and saves it to the file upload location.
Syntax
function encryptPDF(sourceRealName: string, password: string): string
| Parameter | Description |
|---|---|
sourceRealName
|
Unique internal ID of the source PDF file (real name). |
password
|
Password required to open the protected PDF. |
Return Value
Returns a string containing the protected PDF's real name.
Examples
In this example:
- We create a password protected copy the Contract_f4340f5d-d639-4769-9a8e-5db40328d449.pdf file using the pwd password.
- We save the real name of the protected file in a variable called message.
- We display the message variable on screen. For details on how to display messages, see setMessage.
message = encryptPDF('Contract_f4340f5d-d639-4769-9a8e-5db40328d449.pdf', 'pwd');
setMessage(message);