Quickstart guide

Here's how to get started creating PDFs with PDF Potion:


  1. Register for a PDF Potion account
  2. Install the PDF Potion plugin
  3. Design your PDF
  4. Add the 'Create PDF' workflow action
  5. Link PDFs to items in your database
  6. Download PDFs immediately (optional)

Register for a PDF Potion account

Estimated time: 1 minute

Navigate to the PDF Potion homepage and click on the 'Register / Sign in' or 'Get Started' button.

This will bring you to the 'Register' page where you can register for an account. You'll then have access to the PDF Potion dashboard.


Install the PDF Potion plugin

Estimated time: 1 minute

Go the 'plugins' tab in the editor of the Bubble app that you're using PDF Potion in. Search for PDF Potion and install the free plugin.

Once you've installed the plugin, you'll need to add your unique Access Token to PDF Potion in the 'plugins' tab. To get your access token, go back to your PDF Potion dashboard and navigate to the 'My Account' tab and click on the 'Generate Access Token' button:

Copy and paste this access token into the 'Access Token' and 'Access Token - dev.' fields in the 'Plugins' tab:

Note: PDF Potion does not provide separate access tokens for dev and live versions of your app. You use the same access token for both.


Design your PDF

Estimated time: 5-50 minutes (depends on how complex your PDF is)

Create a new page in your Bubble app and design your PDF there. You can check out our tips for designing beautiful PDFs in our Knowledge Base.


Note: It is NOT recommended to give users access to the page where you design your PDFs.



Add the Create PDF workflow action

Estimated time: 1 minute

Once you've installed the PDF Potion plugin, you'll now have access to a workflow action called 'Create PDF'. Add this to the workflow that you want to trigger the PDF creation.

There are 4 fields that must be filled out in order to generate a PDF:


Website Home URL: Add the dynamic expression 'Website home URL'

Page Name: The name of the page where you designed your PDF

The Identifier and Callback URL fields must also be filled out to link a PDF to an entry in your database. They are discussed in the next section.

You can now generate a PDF. Trigger the 'Create PDF' action and navigate to the 'File Manager' area in the 'Data' tab of your editor. You should see the PDF you designed as the latest entry:

Note: It can take a few seconds for PDF Potion to generate the PDF and send it back to your Bubble database, so you may need to refresh the file manager for the file to appear.

In order for your users to be able to access their PDFs, you'll need to link the PDFs to items in your database - see the next section for full details.



Estimated time: 5 minutes

To link PDFs to items in your database, you will need to fill out the Identifier and Callback URL fields in the 'Create PDF' action.


Identifier

This field should be the unique id associated with whatever custom data type in your database you are attaching the PDF to. For example, in the below app we've created a custom data type called 'Report' and are creating a new Report immediately before running the 'Create PDF' workflow action:

It is recommended to add a text field called 'link' or similar to your custom data type. This will be needed to allow your users to access the PDF (see the next section for full details).

You do not need to change any fields when initially creating the 'Report' (or whatever custom data type you're using). The key is that we're able to use the unique ID associated with the 'Report' for the Identifier field in the 'Create PDF' workflow action:

Callback URL

The Callback URL will represent a backend workflow that will be triggered once PDF Potion has created the PDF.

In order to create a backend workflow, you'll need

  • To be on at least a Starter Bubble plan
  • To have enabled Workflow API and Backend Workflows in the 'API' section of the Settings tab in your Bubble editor

Create a backend workflow (I've called mine 'get_pdf') and add two Key values: id and link (both of text)

Add a 'Make changes to a thing' workflow action to this workflow and Do a search for the first 'Report' where it's unique ID = id:

This means the workflow is going to make a change to the 'Report' in your database that has a unique ID that matches what was added to Identifier field in the 'Create PDF' workflow action.


You can then add the 'link' to the Link field (or whatever you're using) you have added to your custom data type:

This will result in a URL linking to the PDF being added to the 'Report' you create when running the 'Create PDF' action.


You'll now need to get the URL that represents this backend workflow and add it to the Callback URL field. To get this URL, follow these steps:

  • Navigate to the API section of your 'Settings' tab and copy the Workflow API Root URL


  • Paste this URL into the Callback URL and add in a '/' and the name of your backend workflow to the end of it

  • It is also recommended to change everything before the 'api/...' part of the URL with the 'Website home URL' dynamic expression
  • This will mean Bubble will correctly upload the created PDFs to either the live or development version of your app (depending on which version you trigger the action from)


Each time you run this workflow action, you'll now see an entry created in your Bubble database that has a link to the PDF you created.


Download PDFs immediately

Estimated time: 3 minutes

If you want your users to be able to access their PDF immediately, you can follow these steps:

  • Add a custom event to the page where users generate PDFs (we've called our custom event 'PDF Created'
  • Add a parameter to the custom event called 'Report' (or similar) with the type of data equal to whatever custom data type you're using to link to the PDF

  • Add the 'Download PDF' action to this workflow and set the 'link' field equal to 'Report's Link' (or whatever you're using for the custom data type and link) and the File name to whatever you want

  • You will now need to trigger this custom event whenever a PDF is created by PDF Potion
  • To do this, add a 'Trigger custom event when data changes' action to the original workflow that had the 'Create PDF' action

  • The 'Thing to watch' is the 'Report' (or whatever custom data type you're using) that you created in step 1 of the workflow and the 'Field to watch' is 'Link' (or whatever field you're using to store the URL to the PDF)

  • Your users should now be able to download PDFs in their browser straight away (or at least after the few seconds it takes PDF Potion to generate the them)

Note: You can add a loading screen while the PDFs are being generated for a better UX. See this article for full details.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.