# Setting PDF Security Options

Spread for ASP.NET allows you to specify PDF security options when saving to a PDF file. Learn the various options available in the security dialog.

## Content

You can specify PDF security options when saving to a PDF file.
You can display a security dialog for the user ([ShowPDFSecurityPopup](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.CommandBarInfo.ShowPDFSecurityPopup.html) property) or you can set security options with the [SavePdf](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.SavePdf.html) or [SavePdfToResponse](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.SavePdfToResponse.html) method.
The following image displays the security dialog.
![Set Password dialog box](https://cdn.mescius.io/document-site-files/images/346c9178-0ed8-4fb9-908b-1565b22fb408/artwork/pdfpassworddialog.png)
The security dialog has the following options:

| **Option** | **Description** |
| ------ | ----------- |
| Owner Password | This allows full (owner) access to the document.<br>This unlimited access includes the ability to change the document’s passwords and access permissions. |
| User Password | This allows additional operations to be performed according to the user access permissions specified in the document’s encryption dictionary. |
| Allow Print | This allows you to print the document when it is opened with user access permission. |
| Allow Copy | This allows you to copy text or graphics from the document when it is opened with user access permission. |
| Allow Fill In | This allows you to permit filling in form fields in the document when it is opened with user access permission. |
| Allow Assembly | This allows you to permit the following operations when the document is opened with user access permission: Insert, rotate, or delete pages, and create bookmarks or thumbnail images even if Allow Modify Contents is unchecked. |
| Allow Modify Contents | This allows you to permit modifying the document’s contents when it is opened with user access permission. |
| Allow Modify Annotations | This allows you to permit adding or modifying annotations in the document when it is opened with user access permission. |
| Allow Accessible Readers | This allows you to permit extracting the text and graphics of the document for accessibility purposes. |

## Using Code

1. Set the [ShowPDFButton](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.CommandBarInfo.ShowPDFButton.html) property.
2. Set the [ShowPDFSecurityPopup](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.CommandBarInfo.ShowPDFSecurityPopup.html) property.

## Example

This example displays the PDF security dialog when you select the PDF button on the command bar.

```csharp
FpSpread1.CommandBar.ShowPDFButton = true;
                FpSpread1.CommandBar.ShowPDFSecurityPopup = true;
```

```vbnet
FpSpread1.CommandBar.ShowPDFButton = True
                FpSpread1.CommandBar.ShowPDFSecurityPopup = True
```

## See Also

[CommandBarInfo Class](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.CommandBarInfo.html)