Skip to main content

ToolJet

Prerequisites

  • A PolyDoc account and API key — sign up for free, no credit card required. The free plan includes 150 PDF conversions per month.
  • A ToolJet instance — sign up for free on ToolJet Cloud or self-host the open-source edition.

Use Case 1: Generate PDFs from App Data

Build an internal tool that generates PDFs on demand by calling PolyDoc from a REST API query bound to a button.
Button click → REST API query (PolyDoc) → Download PDF

Add a REST API datasource for PolyDoc

In your ToolJet app, go to Datasources → Add datasource → REST API. Configure:

  • Base URL: https://api.polydoc.tech
  • Default headers: Authorization = Bearer YOUR_API_KEY (get from the Dashboard), Content-Type = application/json, X-Sandbox = true
Screenshot placeholder: /img/guides/tooljet/tooljet-uc1-datasource.png

Create a query to call PolyDoc

Create a new query using the PolyDoc datasource:

  • Path: /pdf/convert
  • Method: POST
  • Body: JSON referencing component values with {{components.table1.selectedRow.field}} syntax to populate your PolyDoc template dynamically.
Screenshot placeholder: /img/guides/tooljet/tooljet-uc1-query.png

Build the UI with a table and button

Drag a Table component onto the canvas and bind it to your data (a database query or REST API). Add a Button component labeled "Generate PDF" near the table.

Screenshot placeholder: /img/guides/tooljet/tooljet-uc1-ui-layout.png

Bind the button to run the query and download

Select the button and set its On click handler to Run query → your PolyDoc query. Add a second event to download the binary response as a file. Click the button on a test row to verify the PDF downloads correctly.

Use Case 2: Automated PDF via Workflow

Use ToolJet Workflows to generate PDFs in the background, triggered by a webhook, schedule, or app event.
ToolJet workflow → REST API step (PolyDoc) → Email / Webhook

Create a new workflow

Navigate to Workflows in the ToolJet sidebar and click Create workflow. Give it a descriptive name (e.g. "Generate Invoice PDF").

Screenshot placeholder: /img/guides/tooljet/tooljet-uc2-create-workflow.png

Add a trigger

Add a trigger to start the workflow. Choose Webhook for external triggers, Schedule for time-based runs, or App event to call it from a ToolJet app.

Screenshot placeholder: /img/guides/tooljet/tooljet-uc2-trigger.png

Add a REST API step for PolyDoc

Add a REST API step. Select the PolyDoc datasource and configure the POST request to /pdf/convert with a JSON body mapping trigger data to your template fields.

Screenshot placeholder: /img/guides/tooljet/tooljet-uc2-rest-step.png

Add an output step

Add a final step to deliver the PDF — an SMTP step to email it, or a Webhook response to return the PDF data to the caller. Test the workflow end-to-end before enabling the trigger.