Bubble Page to PDF Converter Plugin

Demo to preview the settings:

Introduction

This plugin will help you generate a PDF of the desired data so that you can share it with other users of your platform and save the created file in the database quickly and easily.
Applying the plugin to your bubble app is simple. You only need to place the plugin element on your page and call in the workflow the action Generate pdf from HTML server-side. File uploads enabled - if you want the generated files to be saved in AWS please set this file with "YES".

Tutorial

Plugin element

The plugin comes with one element.
Image without caption

Plugin actions

The plugin element comes with a Generate pdf from HTML server-side action.
Convert PDF ConvertertoPDFv2.0 (Deprecated old action)

1. Action โ€œGenerate Pdfโ€

๐Ÿ’ก
โญโญโญThis action was released on 19/06/21 and it was an important plugin improvement that gives the possibility to convert PDF in super high quality.โญโญโญ
Image without caption
Image without caption
  • Element - the plugin element that will perform the action.
  • Convert target - export the whole page or just an element with a specific ID.
  • Element ID - If in the field above it is set to a single element' enter its ID here.
  • Orientation - Defines the PDF page orientation (landscape or portrait).
  • Format - generated page size. Choose any standard format or set the "custom format".
  • Units - the field is working with the custom form parameter, which means the units of measure for the pdf page.
  • Custom Format - This field is used only if it was previously selected as the "custom format". In any other case, it will be ignored. Set the width and height by separating them with a comma (1300, 840);
  • Calculate scale from "Custom Formatโ€ - calculate a transformation that resizes an element on the paper from "Custom Formatโ€
  • Ignored elements ID - plugin ignores all the elements whose IDs are specified in this field when generating the PDF.
  • Pagebreak IDs - Elements IDs that are going to be printed on different pages. For instance, three groups should be printed on different pages. Specify these group IDS in this field.
  • Page Break Inside Avoid - Put the ID of the elements you want to prevent from being split across two pages when printing. This field does not work for the old responsive layout. If you set this feild id and the element is still cut, it means that the element is too large to fit on a single page.
  • Styles for Print - Can define different style for screen and a printer.
  • Direction of text - Use rtl for languages written from right to left (like Hebrew or Arabic), and ltr for those written from left to right (like English and most other languages).
  • Top\Bottom\Left\Right Padding - set these fields to the desired padding.
  • Header Height - Height.
  • Header Template - HTML template for the print header. For example, would generate a span containing the title. The plugin has some standard classes that you can use to display the number of pages, title, and total pages:
  1. dateย  - formatted print date.
  1. titleย ย - document title
  1. urlย  - document location
  1. pageNumber - current page number
  1. totalPagesย - total pages in the document For example, you want to display the number of pages and and total page
For example, if you want to display the number of pages and total page, it needs in the field "Header" to write the following HTML: <div class="pageNumber"></div> <div class="bar">/</div> <div class="totalPages"></div>
<style> .pageNumber, .totalPages, .bar{ font-size: 14px; margin-left: 20px; } </style> Ex:
Image without caption
  • Footer Height - Height.
  • Height footer - HTML template for the print footer. For example, would generate a span containing the title. Has the same constraints and support for special classes as the header.
  • Output file name - Custom Filename.
  • Upload File to AWS - when the checkbox is checked, it means the file will be saved in the file manager in Bubble.
  • Attach To Type - Type of date
  • AutoSave to PDF after converting - when the checkbox is checked the PDF file will be automatically downloaded to a user's PC.
๐Ÿ’ก
This plugin does not support processing 3D elements in Canvas. Using it for 3D objects or elements may result in limited functionality or unexpected errors. We recommend using dedicated solutions for rendering and manipulating 3D objects.
โš ๏ธ
If you want to get several pages of the equal size and format, you need to lease the content of your page into separate groups and indicate these group IDs in the Pagebreak IDs field. For more details, please check the demo page setup (Popup with 5 pages): https://bubble.io/page?type=page&name=page-to-pdf&id=zeroqode-demo-01&tab=tabs-2

2. Save in S3 Bucket

To use this action, it is necessary to set the Keys in the plugin settings

Setting the keys

  • Create an account on the desired Cloud storage which is compatible with the AWS SDK.
  • Go to the Access Keys and create a new access key.
Image without caption
example: Created key in Wasabi
Image without caption
  • Insert the access key/secret from the plugins tab Access key ID and Secret Access Key.
Endpoint - isย one end of a communication channel. When an API interacts with another system, the touchpoints of this communication are considered endpoints. For APIs, an endpoint can include a URL of a server or service. To connect to a cloud service, which is compatible with AWS SDK, use an endpoint. An endpoint can be found in the cloud dashboard or it can be found in the documentation after the keyword "s3 endpoints ${name cloud storage}โ€. Ex: Wasabi: s3.${Region}.wasabisys.com , Amazon: s3.${Region}.amazonaws.com
  • Insert the endpoint in the plugin field
Image without caption
  • Please set the CORS policy in the cloud dashboard on your own.
Image without caption
Bucket name Pre-signed URL - the link you receive in the pre-signed URL state

3. Resetting states

Resetting states - it is an action that will reset the states of the 'Convert to PDF' element.

Element Events

  • Uploading to AWS is finished
  • Converting is finished
  • Pre-signed URL - is an event that shows that the Pre-signed is ready for use

Element Stat

  • converting is finished
  • output file URL
  • uploading to file manager is finished
  • pre-signed URL - It is a link signed can be used to enable the "Save to bucket" action to save a file to an Amazon S3 (Simple Storage Service) repository or any other compatible S3 cloud (this link has an expiration period);

Tips

  1. Send a file on email.
Image without caption
2. How to set a private image so that the plugin can print it
  • Go to app settings and select the "API" tab.
Image without caption
  • Here you will find the "Generate a new API token" button. Generate the token and return to the private image.
Image without caption
  • Add the token to the image URL. EX:image_url?api_token=newToken
Image without caption

Changelogs

Update: 08/14/2019 -
We made an update to the plugin, the latest release comes with new features and fixes/changes:
  • Pages padding, added new field Bottom Padding (in pixels).
  • Fixed Top Padding that worked only for the first page.
  • Name change for propriety X indent -> Left Padding
  • Name change for propriety Y indent -> Top Padding
Note: The latest implementation will work only with the following proprieties settings:
The Target Format should be set to Custom format The Source Format should be set to Auto-detect
Update 10/05/2020-
We made a major plugin update, the latest release comes with the following list of features/fixes/changes:
  • fixed PNG/SVG issues (present on preview, disappear on the converted file);
  • fixed CORS conflicts with the plugin;
  • fixed "letter"/"governmental-letter" Formats;
  • fixed other small bugs;
  • added a new plugin element (Convert to PDF V 2.0);
  • the Pagebreaker element was removed from the latest plugin version.
Update: 08/02/2021 โ€“
  • Fixed problem with rendering Arabic alphabet
Update: 12/03/2021 -
  • Fixed problem with an empty value (1.46.0)โ€‹
Update: 14/03/2021 -
  • CORS improvement for SVG files (1.47.0)
Update: 19/06/21 - Version: 1.50.0 (A better PDF quality!)
  • Add a new action generate pdf on the server-side.
Update 14/07/2021 - Version 1.51.0
Image without caption
  • Improved the method of saving URL
Update: 16/09/2021 - Version 1.55
  • The fields responsible for the margin (the default values were added to the Padding fields in the new server-side action)
Image without caption
Update: 03/11/2021 - Version: 1.56.0
  • Fixed the problem with radio buttons and checkboxes
Update: 12/11/2021 - Version: 1.57.0
  • Changed the logic for ignored items
Update: 26/01/2022 - Version: 1.58.0
  • fixed problem with multi-input
Update: 18/03/2022 - Version: 1.59.0
  • removed an old element and its actions
Update: 18/04/2022 - Version: 1.60.0
  • Fixed problem with languages written from right to left
Update: 3/05/2022 - Version: 1.61.0
  • option rotation removed
Update 24/06/2022 - Version: 1.62.0
  • Fixed problem with bubble Rich text
Update 19/07/2022 - Version: 1.63.0
  • removing the native preloader from the PDF
Update 06/10/2022 - Version: 1.67.0
  • fixed problem with Asiatic alphabets
Update 16/10/2022 - Version 1.68.0
  • minor fix
Update 03/11/2022 - Version 1.69.0
  • Adjusted for new page structure
Update 20/12/2022 - Version 1.70.0
  • "added page-breakโ€
Update 23/12/2022 - Version 1.71.0
  • Updated description
Update 25/12/2022 - Version 1.72.0
  • "Page break for RGโ€
Update 26/12/2022 - Version 1.73.0
  • Added a note
Update 16/02/2023 - Version 1.78.0
  • the ability to generate large pdf
Update 16/02/2023 - Version 1.79.0
  • minified code
Update 16/02/2023 - Version 1.80.0
  • set scroll position for element as it needs
Update 16/03/2023 - Version 1.83.0
  • added a possibility to upload files to the File Manager (PDF file type)
Update 10/04/2023 - Version 1.84.0
  • added possibility to set the scale from 'Custom form' if you have an element for ignore
Update 12/04/2023 - Version 1.85.0
  • Fixed issue with the "ignore element" in a new responsive
Update 04/07/23 - Version 1.88.0
  • Fixed problem with the variable style
Update 06/07/23 - Version 1.89.0
  • Fixed problem with the style variable
Update 13/09/23 - Version 1.93.0
  • Minor updates
Update 03/11/23 - Version 1.96.0
  • Default value set for element without fixed size
Update 16/11/23 - Version 1.97.0
  • Fixed the problem with hidden cell
Update 22/11/23 - Version 1.98.0
  • Was added possibility that use CSS for print
Update 28/11/23 - Version 1.99.0
  • Fixed the order for page breaker
Update 05/12/23 - Version 1.100.0
  • Fixed the problem with margin top when was set 'page brake' in groups with size set to fix
Update 18/01/24 - Version 1.112.0
  • Updating the documentation to the fields
Update 31/01/24 - Version 1.114.0
  • Fixed the problem with responsive engine.
Update 22/02/24 - Version 1.115.0
  • Optimization of the saving process in the PC
Update 23/02/24 - Version 1.116.0
  • Fixed problem with page parsing
Update 23/02/24 - Version 1.117.0
  • The problem with render dropdown has been solved
Update 15/03/24 - Version 1.118.0
  • Fixed problem with parsing dropdown
Update 02/04/24 - Version 1.119.0
  • Possibility to set dynamic date in margin fields
Update 03/04/24 - Version 1.120.0
  • updated description
Update 04/04/24 - Version 1.121.0
  • updated description
Update 09/04/24 - Version 1.122.0
  • The scale calculation method was improved
Update 09/04/24 - Version 1.122.0
  • The scale calculation method was improved
Update 09/04/24 - Version 1.123.0
  • minor update
Update 23/04/24 - Version 1.124.0
  • was added integration with S3 bucket
Update 21/06/24 - Version 1.125.0
  • Minor update
Update 05/06/24 - Version 1.126.0
  • Was added "Page Break Inside Avoid" and "Attach Toโ€
Update 06/06/24 - Version 1.127.0
  • Minor update - (a marketing update)
Update 10.06.24 - Version 1.128.0
  • Updated demo/service links (a marketing update)
Update 19.06.24 - Version 1.129.0
  • Minor update - (a marketing update)
Update 04.07.24 - Version 1.130.0
  • The automatic parsing of repeated groups and prevention of cell splitting across pages has been removed
Update 12.07.24 - Version 1.131.0
  • Added an action to reset the states belonging to the plugin and added a state with the name of the file saved in the S3
Update 16.07.24 - Version 1.132.0
  • Minor update (Marketing update)
Update 20.07.24 - Version 1.133.0
  • Minor update
Update 22.07.24 - Version 1.134.0
  • Minor update (Marketing update)
Update 23.07.24 - Version 1.135.0
  • Reading icons in for the new version of bubble
Update 09.09.24 - Version 1.136.0
  • Fixed problem with protocol
Update 11.10.24 - Version 1.137.0
  • The possibility to create PDFs larger than 100MB