TOF PDF Document Viewer
Overview
This is the successor of the TS PDF Document Viewer widget. Feel free to reach out to us for feature requests and bug reports via freek.brinkhuis@theorangeforce.com
Use this widget if you want to display PDF files inline in your Mendix application. The TOFPDFDocumentViewer_Example module includes a page with the widget and a microflow to render the PDF document on a web page.
Documentation
Description
Use this widget if you want to display PDF files inline in your Mendix application. The ExampleImplementation folder includes a page with the widget and a microflow to display the PDF file in a web page.
Typical usage scenario
You have a requirement to display PDF files
Features and limitations
Only supports PDF for now
Dependencies
- Mendix Studio Pro 9.24.7 and up
Installation
Download the widget and inspect the ExampleImplementation module. Copy the widget to your own page and attach the System.FileDocument (Specialization) or the Base64 encoded string value.
Configuration
Add the DocumentViewer widget to a dataview. If you have a FileDocument entity or specialisation, select this as input.
If you like to use a base64 implementation the System.FileDocument is no longer needed.
The buttons for navigating through the pages have very basic styling. You can add your own button class in the widget and add some own styling in your Mendix stylesheets.
Releases
Full rebuild. This release replaces the original widget implementation with a modern TypeScript codebase. The widget is fully compatible with Mendix 10 and functions as a
drop-in replacement for existing configurations.
---
New features
- Text selection and copy — Enable the new Text selection property to allow users to select and copy text from
PDF content. Zoom and text selection work simultaneously: pinch and zoom buttons remain active while left-click is reserved for text selection.
- Zoom buttons — In/out buttons are now rendered in the toolbar alongside the existing page navigation when zoom is enabled.
- Hidden toolbar with external control — The toolbar can be hidden via the Show toolbar property. Three new optional attribute bindings — Current page, Total pages, and Zoom
level — allow other Mendix widgets and microflows to read and control the viewer programmatically.
- Studio Pro validation — The widget now warns in Studio Pro when no document source is configured, and hides irrelevant properties based on your settings.
---
Improvements
- The PDF.js worker is now bundled inside the widget — no external CDN dependency. The widget works in offline and intranet deployments.
- The File property now uses Mendix's native file document type, replacing the previous workaround using a raw Long attribute and manual URL construction.
- Upgraded to react-pdf v9 and react-zoom-pan-pinch v3.
---
Breaking change
The fileId and fileChangedDate properties have been replaced by a single File property of type File Document. Existing configurations will need to rebind the document source.