> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/5-dokumenty-i-zaloczniki/podglad-pdf-pdfviewer.md).

# PDF preview - PdfViewer

{% hint style="info" %}
Availability of the functionality depends on the license and may not be available in all deployments.
{% endhint %}

The component allows displaying a PDF document directly on the form. The document can be specified using a file path available in the environment or a URL to an external resource. This allows the user to review the content (e.g. regulations, agreement, or instructions) without having to download the file to disk or open a new browser tab.

![](/files/e5d7e5c49ffe5848729025fa741cd1c45020268c)

✅ **When to use:**

* Displaying a single PDF document directly on the form.

:x: **When not to use:**

* Presenting a list of documents or enabling their download. Use: [DocumentList](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/5-dokumenty-i-zaloczniki/lista-dokumentow-documentlist.md).
* Providing the user with a link to a document or other resource without displaying its content on the form. Use: [ExternalLink](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/0-struktura-i-nawigacja/nawigacja/link-externallink.md).

## PDF viewer component

![Figure 1. Example appearance of the component on the form](/files/fce5bcf9e84ce3238df516d7ea671a9e76ef4a7c)

### Component properties

| Eximee Designer properties                                                      | Attribute name in Source | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>PDF link</strong><br>(section <strong>Basic properties</strong>)</p> | pdfUrl                   | <p>A relative path to a file placed in a folder in the environment, or an external link, however in that case it must meet the CORS policy requirements (the Access-Control-Allow-Origin header must be set appropriately).</p><p>By default, the property is set to empty.</p><p><strong>Important:</strong> Entering an incorrect URL or not entering one at all causes an error and prevents the application from being filled in after attempting to display the PDF file.</p> |

> More information about component properties: [Common component properties](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/wspolne-wlasciwosci-komponentow.md)

### Component configuration

The PDF file address should be configured in the field `PDF link` in the component properties panel. This value can be entered directly as a static link or passed dynamically using a variable.

1. Path to a file available in the environment

   This involves providing a path to a static resource placed directly in the application server's directory structure.

   ![Figure 2. Component configuration using a local path](/files/e8ca08a369a06928f5c2e6024f2519b7da3afba2)
2. External URL address

   This involves providing an absolute URL to the file. However, the external server must allow the browser to download the file from the application, in accordance with the CORS policy.

   ![Figure 3. Component configuration using an external URL address](/files/398b7dc5291f12ef80bb45760bdc3dea0a5b0e58)

{% hint style="info" %}
CORS is a security mechanism in web browsers. It blocks downloading resources (e.g. PDF files) from a domain other than the one where the form is located, unless the target server explicitly allows it by sending the appropriate HTTP header (`Access-Control-Allow-Origin`).
{% endhint %}

3. Filling the component with a session variable value

   The PDF file address can be dynamically filled with a session variable value. In the field `PDF link` you can use a reference to a variable (e.g. `${pdfUrl}`), which will be filled with a value coming from a script or service.

   ![Figure 4. Component configuration using a session variable](/files/33f394f361551b4e3ce044fe33d5f8b134accf7f)

   ![Figure 5. Session variable filled with a value from a script](/files/ca11fa503f96644afa728ff732209d7686ad2617)

{% hint style="info" %}
When filling the component with a session variable, remember to add a listener for this variable.
{% endhint %}

{% hint style="info" %}
Note that the session variable value cannot be empty — otherwise the application will not work properly after attempting to display the component.
{% endhint %}

{% hint style="info" %}
Demo applications: demoPdfViewer
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/5-dokumenty-i-zaloczniki/podglad-pdf-pdfviewer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
