Atlas Forms
PDF Viewer
The pdf-viewer control renders a PDF document inline using the browser's built-in PDF engine. Use it to display contracts, reports, policy documents, or generated invoices that a user must review as part of a form workflow.
Minimal Example
{
"id": "contract-pdf",
"type": "pdf-viewer",
"label": "Service Agreement",
"width": "full",
"settings": {
"src": "https://cdn.example.com/contracts/sla-v3.pdf",
"height": "600px"
}
}
Settings Reference
| Setting | Type | Default | Description |
|---|---|---|---|
src | string | — | URL to the PDF file. Supports template expressions: {{context.document.url}} |
height | string (CSS) | "600px" | Viewer panel height |
initialPage | number | 1 | Page number to open on load |
zoom | string | "page-width" | Initial zoom level: page-width, page-fit, or a percentage like "100%" |
showToolbar | boolean | true | Show or hide the browser PDF toolbar (print, download, zoom controls) |
allowDownload | boolean | true | When false, hides the download button in the toolbar (best-effort — users can still save via browser context menu) |
Dynamic PDF from Context
{
"id": "invoice-viewer",
"type": "pdf-viewer",
"label": "Invoice #{{context.invoice.number}}",
"settings": {
"src": "{{context.invoice.pdfUrl}}",
"height": "700px",
"zoom": "page-width",
"showToolbar": true
}
}
Contract Review Pattern
Show a contract PDF alongside an acknowledgement checkbox. The user must scroll through the document before they can check the acknowledgement:
// Contract review form schema
[
{
"id": "contract-doc",
"type": "pdf-viewer",
"label": "Service Agreement — please review all pages",
"width": "full",
"settings": {
"src": "{{context.contract.url}}",
"height": "650px",
"initialPage": 1,
"zoom": "page-width"
}
},
{
"id": "acknowledged",
"type": "checkbox",
"label": "I have read and agree to the terms of this agreement",
"settings": {
"checkedValue": true,
"uncheckedValue": false
},
"validation": {
"required": true,
"customRule": {
"expression": "values['acknowledged'] === true",
"message": "You must read and agree to the agreement before submitting"
}
}
}
]
Browser Compatibility
| Browser | PDF Rendering | Notes |
|---|---|---|
| Chrome / Edge | Native (PDFium) | Full toolbar, zoom, print |
| Firefox | Native (PDF.js) | Full toolbar, slightly different UI |
| Safari | Native (WebKit) | Toolbar has fewer controls |
| Mobile browsers | Varies | Some mobile browsers open PDF in a new tab instead of inline |
Download Prevention is Advisory Only
Setting
allowDownload: false hides the download button, but determined users can still save the PDF via the browser's right-click menu or by accessing the src URL directly. For truly confidential documents, use server-side access controls (signed URLs, authentication gates) rather than relying on client-side settings.