Now you can make PDF files in back-end workflows at Bubble with PDF Conjurer!
Make more with the PDF Conjurer at server-side using the PDF Make!
You can insert into your PDF file:
Texts
Images
Tables
Columns
Header / Footer
There is a total of 20 server-side actions that you can use in the back-end workflows to build your PDF file. These actions are very similar to those used on the client-side, with some particularities from the server-side Bubble actions! So, if you already use it on the client-side, it will be easy for you to use it on the server-side too!
Each action returns the configurations to the next action, and at the end, the plugin returns a base 64 string that the user can use in other actions in the back-end workflow, including make the file upload!
💡
All actions receive the previous action result (except the “Initialize PDF Document” action), it will be always the first parameter you need to insert into the action! Please don’t forget! Each action will be shown below!
Plugin Actions
Initialize PDF document
Initialize your pdf document and set initial configurations
The first action you should use to start a document, it sets the initial configurations of your PDF Document:
Page size: sets the page size, according to the standard papers sizes accepted by PDF Make.
Page orientation: sets the page orientation, which can be horizontal (Landscape) or vertical (Portrait).
Set page custom margins: allows the use of custom document margins, if not checked, the margins used will be the ones that PDF Make uses by default
Margin left, top, right, and bottom: sets the value of the page margins in points (pt). If the option “Set page custom margins” is not checked, the values will be ignored.
Load font
Upload font files, if you want to use other fonts that are not available by default
Previous step result: Required to load the options from previous actions of this plugin in back-end workflows
Font name: The font name, that you will use in other actions, please avoid using special characters!
Font files: Regular, Bold, Italics, and Bolditalics. You can upload the font files or just copy the files links
💡
We recommend the use of TrueType font file extension (.ttf)
Default fonts that you don’t need to upload:
Roboto, Times New Roman, Courier New, and Helvetica
Not all fonts can be read. If you have a text in Arabic, Chinese, etc., please experiment with the top fonts for these languages and see which one suits you best.
For ex: For example, for a PDF in Arabic, you can use Amiri.
Define new style
Set a custom style that you can use in texts present in the document or tables
Previous step result: Required to load the options from previous actions of this plugin in back-end workflows
Style name: The style name, that you will use in other actions, please avoid using special characters!
Font size: set the font size in points (pt)
Bold: check if you want the text in bold
Italics: check if you want the text in italic or oblique
Alignment: select the text alignment (left, center, right, or justify)
Text color: open the color selector and choose the text color
Font name: the font name you want to use
💡
Remember to use the same font name that you set in the “Load font to PDF” action, or use a preloaded font: Roboto, Times New Roman, Courier New, and Helvetica
Add OR
The add QR action in pdfmarket.js allows you to insert a QR code into a PDF document. This action generates a QR code based on a provided string or URL and places it at a specified location within the PDF.
Add Watermark
The Watermark function in pdfmarket.js allows you to apply a watermark (text or image) to a PDF document. This watermark can be positioned on each page of the PDF, either as a visible overlay or background, depending on the configuration.
Generate SignURL
Generates a Signed Url
Add TOC
The TOC function in pdfmarket.js generates a Table of Contents that lists the sections of the PDF document. It facilitates quick navigation through the document by providing users with a clear structure of the content.
Add text
Draw text into the PDF using some styles options
Previous step result: Required to load the options from previous actions of this plugin in back-end workflows
Text: the text you want to draw into your document, you can use the Bubble Rich text editor for more styles options
Parse BBCode: set to “yes” if you want to interpreter the Bubble Rich Text Editor BBCode in the “Text” field, check out the BBCode Parser manual for more details
Style name: the style name defined into the “Define new style to PDF” action, must be exactly the same inputted there. If the option “Parse BBCode” is enabled the styles defined in BBCode will prevail
Set text custom margins: check if you want to use extra margins in your text element
Margins left, top, right, and bottom: set the value of the margins in points (pt). If the option “Set text custom margins” is unchecked, the values will be ignored
Page Break: choose if you want or not to add a new page, after or before the element
Put into a Multi column: check if you want to put the text into a multi-column structure. Each text element will occupy one column of the structure! Do not forget to start a multi-column structure before (through the “Start multi column on PDF” action)
This Column’s Width: choose if the column will fit the content or will occupy the available space
Multi column name: the multi-column name defined into the “Start multi column on PDF” action, must be exactly the same inputted there.
Is this element being put into the header?: Check if you want to put the text in the page header. Do not forget to activate the document header (through the “Activate header on PDF” action)
Is this element being put into the footer?: Check if you want to put the text in the page footer. Do not forget to activate the document header (through the “Activate footer on PDF” action)
Is this element being put into the background?: Check if you want to put the text in the page background.
Structure name: the repeated structure name defined into the “Start repeating structure on PDF” action, must be exactly the same inputted there. Use it if you want to put the text element into a repeating structure
Text list: A text list that you want to insert into a repeating structure. Each text will be placed into a different structure inside a repeating structure. If you leave this field empty, the text inside the field “Text” will be placed into each structure instead.
Add image
Draw images into the PDF document
Previous step result: Required to load the options from previous actions of this plugin in back-end workflows
Image name: The name that will be used to reference the image, if you want to use it again
Has the image already been used?: Check if you have already used this image in a previous action in the same workflow. This way just enter the same name as before without having to upload the image again
Image: Upload the image or copy the image link. It is required if you have not used the image before, you also can use an external source to find a free image!
Width: set the image width
Height: set the image height
Image alignment: choose the image alignment (left, center, or right)
Use custom margins: check if you want to use extra margins in your image element
Margins left, top, right, and bottom: set the value of the margins in points (pt). If the option “Use custom margins” is unchecked, the values will be ignored
Page Break: choose if you want or not to add a new page, after or before the element
Is this element being put into a Multi Column?: check if you want to put the image into a multi-column structure. Each image element will occupy one column of the structure! Do not forget to start a multi-column structure before (through the “Start multi column on PDF” action)
Multi column name: the multi-column name defined into the “Start multi column on PDF” action, must be exactly the same inputted there.
Column Width: choose if the column will fit the content or will occupy the available space
Is this element being put into the header?: Check if you want to put the image in the page header. Do not forget to activate the document header (through the “Activate header on PDF” action)
Is this element being put into the footer?: Check if you want to put the image in the page footer. Do not forget to activate the document header (through the “Activate footer on PDF” action)
Is this element being put into the background?: Check if you want to put the image in the page background.
Structure name: the repeated structure name defined into the “Start repeating structure on PDF” action, must be exactly the same inputted there. Use it if you want to put the image element into a repeating structure
Image list: A image URL list that you want to insert into a repeating structure. Each image will be placed into a different structure inside a repeating structure. If you leave this field empty, the image selected before will be placed into each structure instead.
💡
If the height and width values are not set, the image will be kept at its original size.
If only the width value has been set, the height will be adjusted to maintain the original image scale.
If only the height is defined, the width will be kept the original of the image.
If the image size is larger than the size it can occupy, the image may be cut off or not appear (especially in columns or in the header/footer), so adjust its size until it appears correctly.
Add table
Draw tables from a list of things
Previous step result: Required to load the options from previous actions of this plugin in back-end workflows
Body text style: the style name defined into the “Define new style to PDF” action, must be exactly the same inputted there. this style will be defined for the body of all columns
Table column width: choose if all table columns will fit the content or will occupy the available space
Create header row in this table?: Check if you want the first row of the table to be a header, if the table takes up more than one page the header will be repeated on all pages
Header text style: the style name defined into the “Define new style to PDF” action, must be exactly the same inputted there. this style will be defined for the header of all columns
Table layout: Choose the table design that you like best. They will be displayed below.
Use table custom margins: check if you want to use extra margins in your table element
Margins left, top, right, and bottom: set the value of the margins in points (pt). If the option “Use table custom margins” is unchecked, the values will be ignored
Page Break: choose if you want or not to add a new page, after or before the table element
Column’s header (1 to 20): the respective column header label, if you do not check the option “Create header row in this table?”, Its content will be ignored, on the other hand, if you leave this cell blank and check the option, the cell will be blank
Column’s body (1 to 20): a list of text that fills the table column, each text will be a table line
Use column (2 to 20): Check if you want to use the respective column, if not checked the column content will be ignored
Is this element put into a Multi column?: check if you want to put the table into a multi-column structure. Each table element will occupy one column of the structure! Do not forget to start a multi-column structure before (through the “Start multi column on PDF” action)
This Column’s Width: choose if the column of multi-column structure (NOT the table column) will fit the content or will occupy the available space
Multi column name: the multi-column name defined into the “Start multi column on PDF” action, must be exactly the same inputted there.
Is this element being put into the header?: Check if you want to put the table in the page header. Do not forget to activate the document header (through the “Activate header on PDF” action)
Is this element being put into the footer?: Check if you want to put the table in the page footer. Do not forget to activate the document header (through the “Activate footer on PDF” action)
Is this element being put into the background?: Check if you want to put the table in the page background.
Start Multi-column
Use to create a multi-column structure in your document, you can add columns to it through the actions: add texts, images, and tables! Each element will be a new column, so if you want, for example, a text with two columns you need to use de action “Add text on PDF” twice
Previous step result: Required to load the options from previous actions of this plugin in back-end workflows
Multi column name: The multi-column name, that you will use in other actions, please avoid using special characters!
Columns gap: the space between the columns in points (pt)
Page break: choose if you want or not to add a new page, after or before the multi column structure
Being repeated: set “yes” if the multi-column will be inserted into a repeating structure
Repeating structure name: the name of the repeating structure you want to place the multi-column into.
💡
If you want to place the multi-column into a repeating structure, the plugin will create a different multi-column for each structure inside the repeating structure, ideal for use with a list of things in actions like add text, and images, because each element in the list will be inserted into a different multi-column! To do that just combine the options to use multi-columns and repeating structures in these actions (add text, and add image)
End Multi-column
Use to end a multi-column structure in your document, and insert it into the document or into a repeating structure
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Multi column name: the multi-column name defined into the “Start multi column on PDF” action, must be exactly the same inputted there.
Being repeated: set “yes” if the multi-column will be inserted into a repeating structure, must be the same choice that you set in the “Start multi column on PDF” action
Repeating structure name: the name of the repeating structure you want to place the multi-column into. Also must be the same choice that you set in the “Start multi column on PDF” action
Active header
Use to enable the header in your document
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Show page number? (counter): check if you want to put the page number into the header
Start count on second page: check if you want that the counter starts on the second page. The counter will be hidden automatically on the first page, and the second page turns the number 1
Even and Odd pages counter alignment: choose where the counter will appear in the respective page number (left, center or right)
Hide page numbers (counter) on specific pages?: check if you want to hide the counter on one or more pages, but the count will not be changed
Hide counter on: the numbers of the pages you want to hide the counter, separated by a comma.
Hide header elements on specific pages?: check if you want to hide the header elements on one or more pages
Hide elements on: the numbers of the pages you want to hide the header elements, separated by a comma.
Left, top, right, and bottom page number margins: the margins of the number counter element
💡
Remember that if you have chosen to start counting on the second page, the number of pages will be counted from that. Please consider this when choosing the pages where the elements or the counter will not appear, because the first page will be number 0.
💡
Header space is limited, so if any elements don't appear then resize them to fit
Active footer
Make it possible to insert content into the document footer
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Show page number? (counter): check if you want to put the page number into the footer
Start count on second page: check if you want that the counter starts on the second page. The counter will be hidden automatically on the first page, and the second page turns the number 1
Even and Odd pages counter alignment: choose where the counter will appear in the respective page number (left, center or right)
Hide page numbers (counter) on specific pages?: check if you want to hide the counter on one or more pages, but the count will not be changed
Hide counter on: the numbers of the pages you want to hide the counter, separated by a comma.
Hide header elements on specific pages?: check if you want to hide the footer elements on one or more pages
Hide elements on: the numbers of the pages you want to hide the footer elements, separated by a comma.
Left, top, right, and bottom page number margins: the margins of the number counter element
💡
Remember that if you have chosen to start counting on the second page, the number of pages will be counted from that. Please consider this when choosing the pages where the elements or the counter will not appear, because the first page will be number 0.
💡
Footer space is limited, so if any elements don't appear then resize them to fit
Start repeating structures
Initialize a repeated structure into the document ideal for some label that repeats yourself or a list of things that have the same structure
In this action, the plugin creates many structures that you want inside the repeating structure!
In other words, these structures, that the plugin creates, are simple lists, that you can insert things on, like texts, images, columns, and tables
You can put the same element in all these lists or when you pass a list of things, each element goes into a different list inside the repeating structure
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Name: The repeating structure name, that you will use in other actions, please avoid use special characters!
How many structures: the number of structures (or lists) that you want to put inside this structure
End repeat structure
Insert the repeated structure into the document.
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Name: The repeating structure name that you entered in the action “Start repeating structure on PDF”
Start repeated table
Start a repeated table structure in your document, ideal for some lists of data that have the same structure, for example, a list of couples: each couple has a list of the names, ages... of each person, so each couple will be a table, and the properties (name or age) will be the tables' columns.
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Table name: The repeated table structure name, that you will use in other actions, please avoid use special characters!
💡
You need to start a repeated structure before initializing a repeated table
Add column to a repeated table
Use to add a column into a repeated table structure, each column will be a list of that main list, you can put a header cell and customize the column text
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Table name: the repeated table structure name that you entered in the action “Start repeated table on PDF”
Thing type: the type of data you want to assemble the tables
Field of things: the data property where a list is found
Data source: the main list, where the other lists are found
Column style: the style defined in the “Define new style to PDF” action that will be applied to the text in this column
Column header: the header label, if the table occupies more than one page, the header will repeat on each page
Header style: the style defined in the “Define new style to PDF” action that will be applied to the text in this column header
Column width: choose if this column will fit the content or will occupy the available space
End repeated table
Use to end a repeated table structure, and insert the tables into the document or in a multi-columns inside a repeated structure
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Table name: the repeated table structure name that you entered in the action “Start repeated table on PDF”
Use table custom margins: set to “yes”, if you want use margins in each table
Table margins left, top, right, and bottom: set the value of the margins in points (pt) for each table. If the option “Use table custom margins” is set as “no”, the values will be ignored
Page break: choose if you want or not to add a new page, after or before each element
Table layout: Choose the table design that you like best. They will be displayed below
Into multi column: set “yes” if you want to insert the tables in multi-columns, remember that the multi-column structure needs to be into the repeating structure.
Multi column name: the multi-column name defined into the “Start multi column on PDF” action, must be exactly the same inputted there.
Multi column width: choose if the column of multi-column structure (NOT the table column) will fit the content or will occupy the available space
Start advanced table
Use to create an advanced table structure, it is similar to a regular table, but you can add as many columns as will fit in your document and style them individually
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Table name: the advanced table structure name, that you will use in other actions, please avoid using special characters!
Add column into advanced table
Use to add a column into an advanced table structure
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Table name: the advanced table structure name, that you entered in the action “Start advanced table on PDF”
List of itens: The list of items the column will be composed of
Text body style: the style defined in the “Define new style to PDF” action that will be applied to the text in this column body
Column width: choose if this column will fit the content, or will occupy the available space, or if it will occupy a fixed width
Fixed width size: If you chose the column to occupy a fixed width, then set the value of this width in points (pt)
Column header: the column text label
Header style: the style defined in the “Define new style to PDF” action that will be applied to the text in this column header
Using images: set “yes” if the list you chose in the "list of items" field is a list of images URL
Image width and height: set the image size, check at “Add image on PDF” action for more information
Use custom margins?: set “yes” if you want to insert margins into all elements in the column (texts or images)
Left, top, right and bottom margins: set the value of all elements margins, if the option “Use custom margins” is set to “no”, the values will be ignored
End advanced table
Use to end an advanced table structure, and insert it into the document, or a multi-column structure, into the header/footer or into the background
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
Table name: the advanced table structure name that you entered in the action “Start advanced table on PDF”
Table layout: Choose the table design that you like best.
Page break: choose if you want or not to add a new page, after or before the table element
Use custom margins?: set “yes” if you want to insert margins into the table element
Left, top, right and bottom margins: set the value of table margins, if the option “Use custom margins” is set to “no”, the values will be ignored
Into multi column: set “yes” if you want to insert the table into a multi-column structure
Multi column name: the multi-column name defined into the “Start multi column on PDF” action, must be exactly the same inputted there
This multi column width: choose if the column of multi-column structure (NOT the table columns) will fit the content or will occupy the available space
Into header: set “yes” if you want to put the table in the page header. Do not forget to activate the document header (through the “Activate header on PDF” action)
Into footer: set “yes” if you want to put the table in the page footer. Do not forget to activate the document header (through the “Activate footer on PDF” action)
Into background: set “yes” if you want to put the table in the page background.
Conjure PDF(server-side)
Use this action to generate the resulting PDF document, it will return the document on a base 64 string format as the content, and the file name with the PDF file extension (.pdf)
Previous step result: required to load the options from previous actions of this plugin in back-end workflows
File name: the PDF file name, it will be added into the document metadata as the title
Set data header: check if you want to add the data header into the base 64 string, we use the data header to open the document into a browser (the base 64 string will start with “data:application/pdf;base64, ...”)
Conjure PDF(client-side)
File name
Save in File Manager
Attach PDF to - his field specifies whether the generated PDF should be attached to another document or entity within the application (e.g., a user profile, order, or report).
Disable browser download
Save to AWS
Pressing URL
Upload PDF
Use this action to upload the resulting PDF via a back-end workflow, but you need a API Workflow that receives a file type field. This action returns the uploaded file URL
Upload file URL: the URL of your API Workflow that uploads the file to the Bubble server (see next page for more details)
File input name: the input name that receive the file (file type) in you API Workflow
File name: the result of the action “Conjure PDF” File name
Content: the result of the action “Conjure PDF” Content
Authentication: if the upload API Workflow needs a authorization token (the API key or a token provided by a authentication API Workflow)
Save In AWS - The Save AWS checkbox is a UI element that indicates whether the data should be uploaded to AWS (Amazon Web Services). When this option is checked, the system will upload the relevant files or data to an AWS storage service (such as S3). If unchecked, the data will not be saved to AWS.
Bucket Name - The Bucket Name field specifies the name of the AWS S3 bucket where files or data will be stored. An S3 bucket is a logical container used for storing objects (files, metadata, etc.) in Amazon S3, and each bucket name must be unique globally across AWS.
Upload API workflow
To configure an upload API workflow is very simple:
Create an API Workflow and give it a name
Add a new parameter with the Type file! Remember the key name to insert into the “Upload PDF” action field “File input name”
Return the file’s URL, using the action “Return data from API” at the “Data (Things)” session
Optional: You can also use “Create a new thing...” to save the file’s data that you want in your database, or use it into another workflow
Workflow example
Initializing your App and initial PDF Conjurer configurations:
Create a new App into your account and add the PDF Conjurer plugin
The server side actions only works into the Backend workflows, so just go to the Top Menu and open the
Backend workflows
In the Backend workflows you can create a workflow like you want (if you have a paid plan), here we create a new API Workflow as example, so give it a name, and make the configurations that you need
2. Use the action Initialize PDF Document to set the initial
configurations of your PDF document
After the Initialize PDF Document action, insert the action that you want to add a content, you can use it in any order that you want
Remember to load the previous step result Configurations into the first field of each action
To use special structures like multi-columns and repeating structures:
After the Initialize PDF Document (Not necessarily right after) action, insert the action that initialize the structure
The content must be between the start action and the end action of the corresponding structure, you can use these fields to specify where the content will be inserted, if none of these fields were used, the content will be inserted into the document
Remember to insert the end action, in order to insert the structure into the document, before the “Conjure PDF” action
Repeated tables must be inserted inside a repeating structure
You can also combine multi-columns with repeating structures, using both fields in the actions!
You can insert repeated tables into multi-colunms when this multi-column are into a repeating structure
To activate the header and footer:
Remember to use the activate header/footer on PDF action, you can use only one or both into your document:
The background doesn’t need to be activated
Insert content into these structures:
You can use the fields in an action to put the element into these structures
💡
The elements into the header or footer are placed into a multi-column, so you can use the columns width property to adjust the content size
💡
If the content is larger than the available space, it will be not displayed correctly
After insert all the content you need:
Use the action Conjure PDF
Set the last action into the first field
Set the PDF Document name
Choose if you want to insert the data header at the result base 64 string
The action returns the base 64 string with the document content, and its name with the pdf extension
Both the file name and the base 64 string can be:
Returned from your API Workflow
Saved into the database
Uploaded it into the Bubble server through the action “Upload PDF” and an upload API Workflow (see next page)
Uploading the PDF document
Configure an upload API Workflow (see page 34) and get your Workflow API root URL at your App Settings panel > API
After the action Conjure PDF:
Use the action Upload PDF in your workflow
Into field “Upload file URL” insert your Workflow API root URL plus “/your_upload_workflow_name”
Insert the key name that receive a file into your upload workflow into the field “File input name”
The “File name” field receives the “Conjure PDF” action File name result
The “Content” field receives the “Conjure PDF” action Content result
If you chose not that the workflow run without authentication, you need to insert the API token or a valid token provided by an authentication API Workflow into the “Authentication” field
The action returns the file's URL if it managed to locate it, in other words if you configured your upload workflow correctly:
You can find the file into the App Data panel > File manager
You can also save the file’s URL in the database, with the other information, like the name and his base64 string!
For example, to generate a list of files (periodic reports), or use it to send in an email, a message, show on a page and the user can click and open the file
FAQ and Common Use Cases.
How to use the plugin with Custom fonts / RTL languages.
If you want to use a different font which is not available by default in plugin or to use the PDF Conjurer with RTL languages you can use the “Load font” action, in this section you can see how to successfully set it up.
Note: Keep in mind that not all fonts are supported by the plugin library, so feel free to experiment with them until you find a font that works specifically for your language and preferences.
How to load a new font:
Identify the font you would like to use: You can search for fonts on Google Fonts: https://fonts.google.com/
Download the desired font to your device: You will find several ".ttf" files.
Upload these files to your Bubble data: They should be of type "file".
Use the links to these files in the "Load font" action by referencing the files in the "Load font" action.
Note: You need to fill all 4 fields to avoid errors, if you need only one font for example you need only regular Onest font, then fill all 4 fields with the same font URL, if you need to use multiple fonts fill the font fields accordingly.
Then use the action "Define new style" to create a style with the font added earlier, make sure to use the exact font name you set up in “Load font” action.
Now you can use the new font in the actions: Create text, Create Multicolum, Create table action, etc.
Note: Make sure to fill the “Style fields” of these actions with the same name as in the previous actions!
Creating text or Inserting Image on a PDF Model threw the following error: TypeError: Cannot read properties of null (reading 'replace')
Actions like Create text or Insert image cannot be left as empty, if you use dynamic data expressions you need to make sure that Bubble doesn’t see them as empty, or else the plugin will throw errors because it doesn’t see what content to display.
You could check how Bubble sees your dynamic expression by launching your page in Step-by-Step mode and paying close attention to the Create Text/ Insert Images actions their dynamic data values shouldn’t be empty!
We suggest considering adding to all actions that rely on dynamic data to add content to your PDF final, to have a condition that will make it so that the plugin skips an action if it has empty data. You can find the screens attached in our previous reply
Example based on a Create text on PDFModel action:
You need to copy the expression and set a condition that will trigger only when the expression is not empty.
By setting it the following way the plugin will skip this action in case it has empty data, and will get to the next one without throwing errors.