Portal Community

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

SettingTypeDefaultDescription
srcstringURL to the PDF file. Supports template expressions: {{context.document.url}}
heightstring (CSS)"600px"Viewer panel height
initialPagenumber1Page number to open on load
zoomstring"page-width"Initial zoom level: page-width, page-fit, or a percentage like "100%"
showToolbarbooleantrueShow or hide the browser PDF toolbar (print, download, zoom controls)
allowDownloadbooleantrueWhen 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

BrowserPDF RenderingNotes
Chrome / EdgeNative (PDFium)Full toolbar, zoom, print
FirefoxNative (PDF.js)Full toolbar, slightly different UI
SafariNative (WebKit)Toolbar has fewer controls
Mobile browsersVariesSome 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.