PDF preview - PdfViewer
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.

✅ When to use:
Displaying a single PDF document directly on the form.
❌ When not to use:
Presenting a list of documents or enabling their download. Use: DocumentList.
Providing the user with a link to a document or other resource without displaying its content on the form. Use: ExternalLink.
PDF viewer component

Component properties
PDF link (section Basic properties)
pdfUrl
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).
By default, the property is set to empty.
Important: 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.
More information about component properties: Common component properties
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.
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 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
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 linkyou 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 
Figure 5. Session variable filled with a value from a script
Last updated
Was this helpful?
