Introduction
Adalo is an app-building software that supports building websites and applications without learning how to code. Its goal is to offer a platform to design and host websites and applications that include databases, workflow actions, and integrations.

You can use PDF Generator API Adalo Component to quickly generate PDF documents using the data you already have in your Adalo application (e.g. store orders, database records). You can find the example application built with Adalo and PDF Generator API Component here.

Example Web Application
Example Mobile Application
Example documents

You can easily clone our example Example Application to speed up the development process.

You can easily clone our example Example Application to speed up the development process.

Setup
To use PDF Generator API Adalo Component, you need a PDF Generator API account. You can create a free Sandbox Account. You can use the free Sandbox Account for 3 months to evaluate and integrate the API. The Sandbox Account allows you to make 2500 merges per month.

The monthly usage (merges) is calculated based on the number of document generation requests multiplied by the number of unique datasets in the request. Read more

Installing the Component
You can install the PDF Generator API Adalo Component from the Adalo Marketplace; you can find an official tutorial on Adalo Help Page.

In the Add Component view, navigate to the Marketplace section and click Explore Marketplace. Then search for PDF Generator API and click Install to install the Component.

Add Component > Marketplace > Explore Marketplace > search "PDF" > Click Install

Configuring the Component
Once you have installed the Component, you can add it to your screen and start the configuration process. The Component has three configuration sections - PDF Generator API, Line items and Button.

PDF Generator API
This section allows you to configure PDF Generator API related parameters like API key, API secret, Workspace identifier, Template Id and JSON Payload.

API key
You can find your PDF Generator API key from the Account Settings view in PDF Generator API.

API secret
You can find your PDF Generator API secret from the Account Settings view in PDF Generator API.

API keys and secrets in Account Settings view

Workspace identifier
The Workspace identifier specifies the request user context. Your default workspace identifier is the email you used to sign up to PDF Generator API. You can also set any other string value. If the workspace doesn't exist yet, it is automatically created when an API request is made.

Template Id
The numeric template id from PDF Generator API.

FileName
Here you can specify the generated file name. You can map fields to create a dynamic file name.

Line items
The Line items configuration allows you to specific Collection that is sent as part of JSON Payload. You can use {{line_items}} placeholder in the JSON Payload to replace it with the Collection data.

JSON Payload
The JSON payload allows you to configure data fields that you can access in the PDF Generator API template. Our example application uses order data with line items to generate invoices. Values can be static or mapped from the Adalo database or Components.

JSON Payload configuration with dynamic values

Example JSON Payload
{
"order_number": "123123",
"status": "paid",
"truck_name": "Yellow Truck",
"location": "Timesquare",
"line_items": [{
"var1": "Sandwitch",
"var2": "5.99",
"var3": "3"
}, {
"var1": "Coffee",
"var2": "4.99",
"var3": "1"
}]
}


Line items
This section allows you to map fields from the Line Items object specified in the PDF Generator API section. In our example application, we use this feature to set line items that belong to the order. For example, var1 is the line item name, var2 is price, and var3 is quantity. You can use {var1}, {var2} and {var3} as placeholders in the PDF Generator API template to show values.



Example JSON Payload
{
"order_number": "123123",
"status": "paid",
"truck_name": "Yellow Truck",
"location": "Timesquare",
"line_items": [{
"var1": "Sandwitch",
"var2": "5.99",
"var3": "3"
}, {
"var1": "Coffee",
"var2": "4.99",
"var3": "1"
}]
}


Button
This section allows you to configure the button style and specify what Actions are executed on button click. For example, you can open the generated PDF URL in a new window.

Open PDF in a new window
To open the generated PDF in a new window we can use Button action External Link. Click on the Magic Text icon in the input and select PDF Generator API > PDF Output.

Use PDF Output (URL) as External Link for Button
Was this article helpful?
Cancel
Thank you!