# Testing PDF production

## Availability

\[SINCE Orbeon Forms 2021.1]

## How to test PDF production

There are two ways to access the "Test PDF" function:

1. directly from the Form Builder's main window's "Test" menu
2. from the "Test Form" window

![The "Test" menu](https://4129616727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LEkBiSDvlXs3VWiO0Zu%2Fuploads%2Fgit-blob-04f69c100f1a77bff35a37cc1d1d0d2df5c2c396%2Ftest-pdf-button.png?alt=media)

When accessed directly, "Test PDF" shows the following dialog:

![The "Test PDF Production" dialog](https://4129616727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LEkBiSDvlXs3VWiO0Zu%2Fuploads%2Fgit-blob-8d023f8b5719565f5518e29e61bd141d1f25fa4b%2Ftest-pdf-no-data.png?alt=media)

When accessed from the "Test Form" window, "Test PDF" shows the following dialog:

![The "Test PDF Production" dialog](https://4129616727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LEkBiSDvlXs3VWiO0Zu%2Fuploads%2Fgit-blob-653479a082ef3d24a1e6d1443d6b3903db45ac31%2Ftest-pdf-use-data.png?alt=media)

You have access to the following options:

* **Use entered form data**
  * This option only shows when accessed from the "Test Form" window.
  * When selected, any data currently entered in the form will be used to produce the PDF.
* **Disable the evaluation of "Initial Values" formulas**
  * If "Use entered form data" is selected, this option is disabled as the form data takes precedence.
  * When selected, all "Initial Value" formulas are disabled, as if they were not present.
* **Disable the evaluation of "Initial Values" formulas**
  * When selected, all "Initial Value" formulas are disabled, as if they were not present.
* **Disable the evaluation of "Calculated Values" formulas**
  * When selected, all "Calculated Value" formulas are disabled, as if they were not present.
* **Show controls, grids, and sections with dynamic visibility**
  * When selected, all controls, grids, and sections that can be dynamically shown are shown.
  * This means that those with visibility "Yes" or "Formula" are always shown. Controls with visibility "No" remain not visible.
  * Use cases include:
    * Verifying that every control, grid, or section that can appear in the PDF appears correctly.
    * Exporting the PDF file for printing and manual filling.
* **Use PDF template**
  * This only shows if the form has attached PDF templates.
  * See below for details.

Selecting "Continue" opens the resulting PDF, which will show in your browser window.

## PDF templates

The "Test PDF" dialog lets you choose between the [automatic PDF](https://github.com/orbeon/orbeon-forms-doc/blob/master/form-builder/pdf-automatic.md) or one of the available [PDF templates](https://github.com/orbeon/orbeon-forms-doc/blob/master/form-builder/pdf-templates.md) when testing.

![Selecting a PDF template for PDF testing](https://4129616727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LEkBiSDvlXs3VWiO0Zu%2Fuploads%2Fgit-blob-de5b4feab0f70951dac924084e3eb1eec5d70243%2Ftest-pdf-use-pdf-template.png?alt=media)

## Showing hints and alerts

[\[SINCE Orbeon Forms 2023.1\]](https://doc.orbeon.com/release-notes/orbeon-forms-2023.1)

Two options allow you to show controls hints and alerts in the resulting PDF:

![Options to show hints, alerts, and required](https://4129616727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LEkBiSDvlXs3VWiO0Zu%2Fuploads%2Fgit-blob-791de5d222e0da4b993bd9696e7fb7b1785839c1%2Ftest-pdf-hints-alerts-required.png?alt=media)

This is an example of the resulting PDF with hints and alerts:

![PDF output with alerts and hints](https://4129616727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LEkBiSDvlXs3VWiO0Zu%2Fuploads%2Fgit-blob-1dccacef237de95b91062177c68931f8ad6c6436%2Ftest-pdf-hints-alerts-result.png?alt=media)

See also [The `open-rendered-format()` action](https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/actions-form-runner#open-rendered-format).

## See also

* Blog post: [Testing PDF production in Form Builder](https://blog.orbeon.com/2021/11/testing-pdf-production-in-form-builder.html)
* [PDF Production](https://github.com/orbeon/orbeon-forms-doc/blob/master/form-builder/pdf-production.md)
* [Automatic PDF](https://github.com/orbeon/orbeon-forms-doc/blob/master/form-builder/pdf-automatic.md)
* [PDF templates](https://github.com/orbeon/orbeon-forms-doc/blob/master/form-builder/pdf-templates.md)
* [The `open-rendered-format()` action](https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/actions-form-runner#open-rendered-format)
* [Testing in web mode](https://doc.orbeon.com/form-builder/advanced/web-test)
* [Testing in offline mode](https://doc.orbeon.com/form-builder/advanced/offline-test)
