> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extractbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PDFOptions

Input options for customizing PDF generation via the 'pdf' query on the Page type.

## Definition

```graphql theme={null}
input PDFOptions {
  displayHeaderFooter: Boolean
  footerTemplate: String
  format: PaperFormat
  headerTemplate: String
  height: String
  landscape: Boolean
  margin: PDFMarginOptions
  omitBackground: Boolean
  pageRanges: String
  preferCSSPageSize: Boolean
  printBackground: Boolean
  scale: Float
  timeout: Int
  width: String
}
```

## Fields

### `displayHeaderFooter`

[Boolean](/reference/graphql/scalars/boolean)

Whether to display header and footer. Defaults to false.
If true, `headerTemplate` and `footerTemplate` can be used to customize them.

### `footerTemplate`

[String](/reference/graphql/scalars/string)

HTML template for the print footer. Should be valid HTML markup with the following classes used to inject printing values into them:

* `date` formatted print date
* `title` document title
* `url` document location
* `pageNumber` current page number
* `totalPages` total pages in the document
  Example: `<div style='font-size:10px; width:100%; text-align:center;'><span class='pageNumber'></span>/<span class='totalPages'></span></div>`

### `format`

[PaperFormat](/reference/graphql/enums/paper-format)

Paper format for the PDF. See `PaperFormat` enum (e.g., A4, LETTER). If set, overrides width and height.
Defaults to LETTER if not specified.

### `headerTemplate`

[String](/reference/graphql/scalars/string)

HTML template for the print header. Same format as `footerTemplate`.
Example: `<div style='font-size:10px; color:grey; margin-left:10px;'><span class='title'></span></div>`

### `height`

[String](/reference/graphql/scalars/string)

Height of the paper. Must be a string with units (e.g., `"11in"`, `"29.7cm"`).
Used if 'format' is not set.

### `landscape`

[Boolean](/reference/graphql/scalars/boolean)

Whether to print in landscape orientation. Defaults to false (portrait).

### `margin`

[PDFMarginOptions](/reference/graphql/inputs/pdfmargin-options)

Margin options for the PDF. See `PDFMarginOptions`. If not specified, default margins apply (usually around 1cm or 0.4in).

### `omitBackground`

[Boolean](/reference/graphql/scalars/boolean)

Whether to omit the background graphics from the PDF. Defaults to false (backgrounds are included).

### `pageRanges`

[String](/reference/graphql/scalars/string)

Paper ranges to print, e.g., `"1-5, 8, 11-13"`. Defaults to all pages.

### `preferCSSPageSize`

[Boolean](/reference/graphql/scalars/boolean)

Whether to prefer page size defined in CSS (`@page`) over options `width`/`height` or `format`. Defaults to false.

### `printBackground`

[Boolean](/reference/graphql/scalars/boolean)

Whether to print background graphics (images and colors). Defaults to false.

### `scale`

[Float](/reference/graphql/scalars/float)

Scale of the webpage rendering. Defaults to 1 (100%). Values less than 1 shrink, greater than 1 enlarge.

### `timeout`

[Int](/reference/graphql/scalars/int)

Timeout in milliseconds for the PDF generation. Defaults to a global setting (e.g., 30000ms).

### `width`

[String](/reference/graphql/scalars/string)

Width of the paper. Must be a string with units (e.g., `"8.5in"`, `"21cm"`).
Used if 'format' is not set.
