Skip to main content
Version: 1.0.8

PDF Viewer

Displays a PDF from the asset library or the uploads folder — manuals, SOPs, drawings — with page navigation, zoom and download. Rendered in a worker, with no external downloads.

The PDF Viewer component as it renders with its default settings.The PDF Viewer component as it renders with its default settings.

Reach for it when you need:

  • The SOP for the equipment on this screen
  • Drawings reachable from the plant mimic

Component name: PdfViewer · Category: Display

In the palette: Displays a PDF document from the asset Library or the Uploads folder (manuals, SOPs, drawings) with page navigation, zoom and download. Rendered by PDFium-WASM in a worker — no external downloads.

Properties​

Any property can be bound to a tag, another component's property, or a query.

PropertyTypeDefaultDescription
fileasset""The PDF (.pdf), from the asset Library or the Uploads folder. Bindable — bind a tag/expression yielding a path (e.g. Docs/Manuals/pump.pdf) or an upload:// ref (e.g. a File Manager widget's {{ <name>.selectedItem.ref }}) to swap the document at runtime. Only same-origin documents are allowed (a cross-origin URL is rejected).
pagenumber11-based page to show. Bindable — drive it from a tag to jump the operator to a page (clamped to the document's range). An operator's own scroll is not overridden until this value changes again.
fitModeenumwidthHow each page is fit to the widget: fit width, fit whole page, or actual size (100%). Options: width · page · actual.
scrollenumverticalPage scroll direction. Options: vertical · horizontal.
showToolbarbooleantrueShow the toolbar (page navigation, zoom, download). Turn off for a clean embedded page.
interactivebooleantrueAllow scroll/zoom gestures in LiveView. The editor always locks gestures until you double-click the widget to enter it.
outputobject{"currentPage":1,"pageCount":0,"loadError":""}Read-only runtime outputs the widget publishes — bind a leaf, e.g. {{ <PdfViewer>.output.currentPage }}.
  ↳ output.currentPagenumber1The page the operator is currently viewing.
  ↳ output.pageCountnumber0The document's total page count (0 until it loads).
  ↳ output.loadErrorstring""A human-readable load error, or empty when the document loaded fine.
stylestyle{}Custom CSS properties

Events​

Attach event actions to these in the Event Manager.

EventLabelGroupPayload
clickClickMouseThe DOM event.
dblclickDouble clickMouseThe DOM event.
contextmenuRight clickMouseThe DOM event.
mouseenterMouse enterMouseThe DOM event.
mouseleaveMouse leaveMouseThe DOM event.
Right-click behaves differently in the Designer

contextmenu fires your configured actions at runtime only — in LiveView and in preview. On the Designer canvas the right-click is captured to open the Event Manager, so testing it there will not run your actions. Test right-click in preview.

Notes​

Works fully offline, which matters on an isolated plant network.

A toolbar that fits narrow spaces Changed in 1.0.8​

When the widget is narrow — in a small grid cell, a sidebar or on a phone — its toolbar shrinks to fit rather than spilling over. It goes by the widget's own width, not the screen's, so a small widget on a large monitor shrinks too. The toolbar used to clip below about 420 px — taking Download with it — on a widget that can be 160 px wide. Now, first the file name hides and fit and download move into a More menu; at the narrowest only page navigation stays on the bar. Nothing is taken away: every control is still there, and a shortened control keeps its full name for screen readers.

The viewer's chrome follows the app theme and the project's colours, like the WYSIWYG toolbar, instead of a fixed slate-and-blue palette of its own. Changed in 1.0.8