# DocGenParams

Optional PDF security, retention, and preview settings for document generation.

> Kind: Apex type · Updated: 2026-07-01

Custom Apex type that carries optional PDF security, retention, and preview-viewer settings for a document generation request. Pass it to Generate Document or Generate Document (Sync) to protect or auto-expire the generated file. All fields are optional; construct with the default constructor and set only the properties you need.

## Fields

### Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| PdfViewPassword | String | optional | Password required to open and view the generated PDF. |
| PdfOwnerPassword | String | optional | Owner (editor) password for the generated PDF. |
| LockPdf | Boolean | optional | Disable PDF editing when true. |
| AllowPdfPrinting | Boolean | optional | Enable PDF printing. Only applicable when LockPdf is true or PdfOwnerPassword is provided. |
| AllowFillingPdfFormFields | Boolean | optional | Enable filling PDF form fields. Only applicable when LockPdf is true or PdfOwnerPassword is provided. |
| Retention | Integer | optional | If provided, the document will be deleted after the specified number of minutes. |
| AllowDownloadInPreview | Boolean | optional | Controls the download button in the preview viewer. Does not affect the API-level downloadUrl. |
| AllowPrintInPreview | Boolean | optional | Controls the print button in the preview viewer. |

## Example

```apex
cldfs.DocGenParams dcp = new cldfs.DocGenParams();
dcp.PdfViewPassword = 'admin';
dcp.PdfOwnerPassword = 'superadmin';
dcp.LockPdf = True;
dcp.AllowPdfPrinting = True;
dcp.AllowFillingPdfFormFields = True;
dcp.Retention = 5;
```
