flattenPDF
Flattens a stored PDF file and saves it to the file upload location. Flattening is the process of transforming an interactive PDF document into a non-interactive PDF, for instance to ensure that a form can no longer be modified after it has been filled.
Syntax
function flattenPDF(sourceRealName: string, outputFileName: string): string
| Parameter | Description |
|---|---|
sourceRealName
|
Unique internal ID of the source PDF file (real name). |
outputFileName
|
File name assigned to the flattened PDF. |
Return Value
Returns a string containing the flattened PDF's real name.
Examples
In this example:
- We save a flattened copy the Contract_f4340f5d-d639-4769-9a8e-5db40328d449.pdf file in a document called signed_contract.pdf.
- We save the real name of the flattened file in a variable called message.
- We display the message variable on screen. For details on how to display messages, see setMessage.
message = flattenPDF('Contract_f4340f5d-d639-4769-9a8e-5db40328d449.pdf', 'signed_contract');
setMessage(message);