# PDFOptions
Class
## About
`PDFOptions` configures `Editor.ToRasterPDF` and `Editor.ToVectorPDF`: document metadata, a header and footer on every page, and protection. Omit the argument, or pass `Nil`, to keep the default output.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Constructor | (None) | (None) | Creates PDF options with no metadata, no header or footer, and no restrictions. |
| HasProtection | (None) | Boolean | Returns whether these options add a password or restrict printing, copying, or modifying. |
| ResolvedText | template As String <br> pageNumber As Integer <br> pageCount As Integer | String | Returns a header or footer template with {page}, {pages}, and {title} replaced for the specified page. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| AllowCopying | Boolean | (None) | Gets or sets whether readers may copy text and images from the PDF. |
| AllowModifying | Boolean | (None) | Gets or sets whether readers may modify the PDF. |
| AllowPrinting | Boolean | (None) | Gets or sets whether readers may print the PDF. |
| Author | String | (None) | Gets or sets the document author written to the PDF metadata. |
| Creator | String | (None) | Gets or sets the name of the application that created the PDF. |
| FooterAlignment | GraffitiProEditor.Alignments | (None) | Gets or sets the horizontal alignment of the footer. Automatic centers it. |
| FooterText | String | (None) | Gets or sets the text drawn in the bottom margin of every page. Supports {page}, {pages}, and {title}. |
| HeaderAlignment | GraffitiProEditor.Alignments | (None) | Gets or sets the horizontal alignment of the header. Automatic centers it. |
| HeaderFooterColor | Color | (None) | Gets or sets the color of the header and footer text. |
| HeaderFooterFontName | String | (None) | Gets or sets the font used for the header and footer. |
| HeaderFooterFontSize | Double | (None) | Gets or sets the font size, in points, used for the header and footer. |
| HeaderText | String | (None) | Gets or sets the text drawn in the top margin of every page. Supports {page}, {pages}, and {title}. |
| Keywords | String | (None) | Gets or sets the document keywords written to the PDF metadata. |
| Language | String | (None) | Gets or sets the document language, such as en-US. Empty leaves it unset. |
| OwnerPassword | String | (None) | Gets or sets the password required to change the PDF permissions. |
| Subject | String | (None) | Gets or sets the document subject written to the PDF metadata. |
| Title | String | (None) | Gets or sets the document title written to the PDF metadata and used by {title}. |
| UserPassword | String | (None) | Gets or sets the password required to open the PDF. Empty lets anyone open it. |
## Notes
The same options work for raster and vector output. Header and footer text is drawn as PDF text in both.
### Header and Footer
`HeaderText` and `FooterText` are drawn on every page, centered vertically in the top and bottom page margins. Empty text draws nothing. `{page}`, `{pages}`, and `{title}` are replaced with the page number, the page count, and `Title`; `ResolvedText` performs the same replacement. Text longer than the content width is condensed to fit.
`HeaderAlignment` and `FooterAlignment` accept `Leading`, `Middle`, or `Trailing`, which follow the editor's direction, so `Leading` is on the right in a right-to-left document; `Automatic` centers. `HeaderFooterFontName`, `HeaderFooterFontSize`, and `HeaderFooterColor` style both.
### Metadata
`Title`, `Author`, `Subject`, `Keywords`, and `Creator` map to the matching `PDFDocument` properties. `Language` uses a two-letter language code and a two-letter country code, such as `en-US`, and is written only when set. `Creator` defaults to `GraffitiProEditor`.
### Protection
Protection uses Xojo's `PDFPermissions`, which also encrypts the file. `UserPassword` is required to open the document. `OwnerPassword` is required to change its permissions. `HasProtection` returns whether either password is set or printing, copying, or modifying is restricted.
Restricting printing, copying, or modifying without an owner password uses a random owner password, so the restrictions cannot be removed. Xojo accepts only Latin characters in PDF passwords and does not offer a separate permission for filling form fields.
## Examples
Create the options, set only what the document needs, and pass them to either PDF method.
### Protected Report
```xojo
Var options As New GraffitiProEditor.PDFOptions
options.Title = "Quarterly Report"
options.Author = "Finance"
options.HeaderText = "{title}"
options.HeaderAlignment = GraffitiProEditor.Alignments.Leading
options.FooterText = "Page {page} of {pages}"
options.FooterAlignment = GraffitiProEditor.Alignments.Trailing
options.AllowCopying = False
options.OwnerPassword = "owner-secret"
Editor.ToVectorPDF(file, options)
```