Skip to main content

PDF Template

The PDF Template widget lets you build custom PDF reports for any module. Your Connected App receives the template definition, formatted record data, and print/download flags — you render the layout and return the final PDF output.

Availability#

AppsMobile
Maintenance, Vendor, Requester, Client, TenantDownload only (via Custom Button)
Mobile implementation

On mobile, only download is supported. Use a Custom Button widget with type Open PDF, mapped to your PDF template. When the user taps the button:

  • Mobile — PDF downloads directly and opens in the system viewer
  • Web — A preview is shown with a download button

How to expose on mobile#

Create a Custom Button with type Open PDF and map it to your PDF template. The button appears on the record page; tapping it on mobile downloads the PDF and opens it in the system viewer; on web it shows a preview with a download button.

When to use#

  • Generating custom work order reports, inspection reports, or invoices
  • Building branded PDF layouts with logos, headers, and footers
  • Controlling which fields appear and where (e.g., logo left or right)
  • Adding charts, tables, or signatures to module reports

Context#

When the widget loads, the context is passed with the following structure:

KeyDescription
templateObject with template details: id, name, moduleId, templateSettingsJSON, templateTypeEnum, etc.
recordFormatted record data (map of field values)
printtrue if rendering in print mode, false otherwise
downloadtrue if rendering in download mode, false otherwise
window.facilioApp.on('app.loaded', (data) => {  const context = window.facilioApp.getContext();  const { template, record, print, download } = context;
  // Use template and record to render your PDF layout  renderReport(template, record, { print, download });});

Triggers#

FunctionDescriptionExample
updateTemplateSettingsStores template-related custom settings (e.g., logo position, which fields to show)See example below

updateTemplateSettings — Pass a JSON object with any template-specific configuration:

window.facilioApp.interface.trigger('updateTemplateSettings', {  logoPosition: 'right',  showFields: ['subject', 'description', 'dueDate'],  headerText: 'Custom Report Header'});

Use this to persist user preferences or layout options that affect how the PDF is rendered.