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

# PDF Params

# PDF Params

<Success>
  **When using reusable templates**, these parameters are set on the interface,
  so you don't need send any extra parameters on the API.
</Success>

### PDF Params options

Here's a list of all the **optional parameters** that you can send as an object "pdfParams" while using our HTML to PDF endpoint:

<ParamField body="displayHeaderFooter" type="boolean">
  Whether to show the header and footer. Default: `false`
</ParamField>

<ParamField body="headerTemplate" type="string">
  HTML template for the header. [See valid HTML markup
  bellow](#header-and-footer-valid-html-markups).
</ParamField>

<ParamField body="footerTemplate" type="string">
  HTML template for the footer. [See valid HTML markup
  bellow](#header-and-footer-valid-html-markups).
</ParamField>

<ParamField body="printBackground" type="boolean">
  Set to `true` to print background graphics. Default: `false`
</ParamField>

<ParamField body="landscape" type="boolean">
  Whether to print in landscape orientation. Default: `false`
</ParamField>

<ParamField body="format" type="PaperFormat">
  All the valid paper format types when printing a PDF. [See all format options
  here](#paper-formats). Default: `Letter`
</ParamField>

<ParamField body="width" type="string | number">
  Paper width, accepts values labeled with units.
</ParamField>

<ParamField body="height" type="string | number">
  Paper height, accepts values labeled with units.
</ParamField>

<ParamField body="margin" type="object">
  Object that sets the margin of every page. [See all margin options
  here](#margin-options).
</ParamField>

<ParamField body="preferCSSPageSize" type="boolean">
  Give any CSS `@page` size declared in the page priority over what is declared
  in the `width` or `height` or `format` option. Default: `false`
</ParamField>

<ParamField body="outline" type="boolean">
  Whether or not to embed the document outline into the PDF. Default: `false`
</ParamField>

<Info>
  The **width**, **height**, and **margin** options accept values labeled with units. Unlabeled values are treated as pixels.

  All possible formats:

  * `width`: 100 (prints with width set to 100 pixels)
  * `width`: '100px' (prints with width set to 100 pixels)
  * `width`: '100in' (prints with width set to 100 inches)
  * `width`: '100cm,' (prints with width set to 100 centimeters)
  * `width`: '100mm' (prints with width set to 100 millimeters)
</Info>

***

### Header and Footer: Valid HTML Markups

HTML template for the print header. Should be valid HTML markup with 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:**

```html theme={null}
<style>
  #header {
    display: none;
  }
  #footer {
    padding: 0 !important;
    margin: 0 !important;
  }
</style>
<div
  style="font-family: inherit; font-size: 12px; color: #64748b; padding: 5px 20px; margin-top: 20px; width: 100%;"
>
  <span>Some custom footer text here</span>
  <div
    style="display: flex; flex-direction: row; gap: 20px; align-items: center; font-size: inherit; color: inherit; justify-content: space-between;"
  >
    <span class="title"></span>
    <p>|</p>
    <span class="date"></span>
    <p style="margin-left: auto;">
      Page <span class="pageNumber"></span> of <span class="totalPages"></span>
    </p>
  </div>
</div>
```

***

### Paper format options <a href="#paper-formats" id="paper-formats" />

| Format name | Size in inches   | Size in cm      |
| ----------- | ---------------- | --------------- |
| `Letter`    | 8.5in x 11in     | 21.6cm x 27.9cm |
| `Legal`     | 8.5in x 14in     | 21.6cm x 35.6cm |
| `Tabloid`   | 11in x 17in      | 27.9cm x 43.2cm |
| `Ledger`    | 17in x 11in      | 43.2cm x 27.9cm |
| `A0`        | 33.1in x 46.8in  | 84cm x 118.9cm  |
| `A1`        | 23.4in x 33.1in  | 59.4cm x 84cm   |
| `A2`        | 16.54in x 23.4in | 42cm x 59.4cm   |
| `A3`        | 11.7in x 16.54in | 29.7cm x 42cm   |
| `A4`        | 8.27in x 11.7in  | 21cm x 29.7cm   |
| `A5`        | 5.83in x 8.27in  | 14.8cm x 21cm   |
| `A6`        | 4.13in x 5.83in  | 10.5cm x 14.8cm |

***

### Margin Options

<ParamField body="margin.top" type="string | number">
  Top margin, accepts values labeled with units. Default: `0`
</ParamField>

<ParamField body="margin.right" type="string | number">
  Right margin, accepts values labeled with units. Default: `0`
</ParamField>

<ParamField body="margin.left" type="string | number">
  Left margin, accepts values labeled with units. Default: `0`
</ParamField>

<ParamField body="margin.bottom" type="string | number">
  Bottom margin, accepts values labeled with units. Default: `0`
</ParamField>

* Example:

```json theme={null}
{
  "margin": {
    "top": 10,
    "right": "10px",
    "bottom": "10in",
    "left": "10cm"
  }
}
```
