The flow2pdf
extension is a bundle that allows directus to print data from flow results and liquid templates.
- Node.js 18 or higher
directus-extension-flow2pdf
installed on your Directus instance.
The extension will add a new interface and endpoint to your directus instance. All configurations are available in the pdf manager interface.
- Create a Flow with
Webhook
trigger and set the method asPOST
, now copy theid
of the Flow. Make sure that the trigger is not asynchronous. - Create a
Button Links
field in the desired collection and chooseFlow2PDF
as the interface. - Create
extensions/template
directory and add your.liquid
template.
Flow Id
: Id of the Flow you will be collecting data from (Note: the last operation of your Flow should return some JSON data ).Behavior
: Accepts two valuesprint
: To print the document from your printerdownload
: To download the document as PDF
Template
: the name of your liquid js template stored inextensions/templates
directory. The data from your flow will be passed to the liquid fie.label
: The label of the buttonIcon
: The icon of the buttonType
: The type of the button. Accepted values areprimary
,secondary
,warning
anddanger
- You can add
MARKETPLACE_TRUST="all"
option in your directus env variables to be able to browser API/Hybrid extensions within the marketplace section of your directus app.