Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions docs/App Extensions/app-extension-examples/share-pdf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Share PDF
author: ''
excerpt: >-
Convert an extension's HTML to a PDF that users can save, share, or print from mobile.
deprecated: false
hidden: false
metadata:
title: ''
description: ''
robots: noindex
next:
description: ''
---

App Extensions let you create focused workflows that make work easier for field users. Use them to present familiar, task-specific information without requiring people to leave the record they are completing.

This page shows how to add a **Share** button to an App Extension. When a mobile user taps the button, the app converts the extension's HTML into a PDF file and presents the platform-native Save, Share, or Print actions.

## Share PDF

Use this when you want field users to generate a shareable, printable, or savable PDF snapshot of the information shown in an extension — for example a completed inspection ticket or a chain-of-custody record.

No changes are needed in the extension's HTML or JavaScript to support this. Any existing App Extension file works as-is — the Share button is controlled entirely by the Data Event, not by anything in the extension page itself.
Comment thread
MariaPaulaGomezPrieto marked this conversation as resolved.

### Add the Share PDF Data Event

Configure the `OPENEXTENSION` data event by adding `actions: ['sharePDF']` to the `data` object.

```js
ON('click', 'open_app_extension', () => {
OPENEXTENSION({
url: 'attachment://sharePDF.html',
title: 'Share PDF Example',
data: {
record_id: RECORDID(),
actions: ['sharePDF'],
},
onMessage: () => {},
});
});
```

### Enabling the Share Button

The Share button that lets users save, share, or print the generated PDF only appears when the Data Event's `data` object includes:

```js
actions: ['sharePDF']
```

If this array is omitted, or the value is misspelled, the extension will render normally but the Share button will not be visible, and users will have no way to export the content as a PDF.

### How It Works

1. The user taps the button configured with the `open_app_extension` Data Event.
2. `OPENEXTENSION` loads the extension file and passes the record data, including the `actions: ['sharePDF']` flag.
Comment thread
MariaPaulaGomezPrieto marked this conversation as resolved.
3. Because `sharePDF` is present in `actions`, the host app displays a Share button on the extension screen.
4. When the user taps Share, the app converts the extension's rendered HTML into a PDF — no special code in the extension's HTML is required for this step.
5. The user is presented with the platform-native Save, Share, or Print options for that PDF.
7 changes: 6 additions & 1 deletion docs/App Extensions/app-extensions-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ App Extensions work the same way on iOS, Android, and web.
- Inspection summary interfaces (verifications, warning confirmations, sign-off screens)
- Charts and dashboards embedded inside a form
- Custom sub-forms (multi-step workflows that feel like a separate app)
- Shareable PDF output (e.g., a chain-of-custody ticket or inspection summary the field user can save, share, or print as a PDF directly from the record)

## How It Works

Expand Down Expand Up @@ -193,7 +194,10 @@ Called from your Data Event script to open an App Extension. See the `OPENEXTENS
OPENEXTENSION({
url: 'attachment://my-extension.html', // or any HTTPS URL
title: 'My Extension', // shown in the panel header
data: { /* any data to pass in */ },
data: {
/* any data to pass in */
actions: ['sharePDF'], // optional — only needed if you want the Share button (PDF export) to appear on mobile
Comment thread
MariaPaulaGomezPrieto marked this conversation as resolved.
},
onMessage: ({ data }) => {
// called when Fulcrum.finish(data) is called in your HTML
}
Expand Down Expand Up @@ -232,3 +236,4 @@ The following examples are available in the Examples section of the docs:
- [Rich Text Editor](https://docs.fulcrumapp.com/docs/rich-text-editor)
- [High Energy Hazard Selector](https://docs.fulcrumapp.com/docs/high-energy-hazard-selector)
- [Illness Symptoms Selector](https://docs.fulcrumapp.com/docs/illness-symptoms-selector)
- [Share PDF](https://docs.fulcrumapp.com/docs/share-pdf)
Loading