PDF Creator
  • Introduction
    • 👋Welcome
    • Quickstart
    • Key use cases
    • Key features
  • Getting Started
    • Installing the plugin
    • Enabling ID attributes
  • Implementing Key Features
    • Generating PDFs of a single element
    • Generating a PDF of multiple elements
    • Downloading PDFs
    • Saving PDFs to your Bubble database
    • Adding footers
      • Page counters
      • Logos
    • Adding headers
    • Customising your PDF
    • Sending PDFs via email
  • Making PDF files private
  • Tips
    • How the plugin scales elements to the PDF page
    • Adding a loading screen
    • Generating PDFs of repeating groups that span multiple pages
  • Troubeshooting
    • 'Can't find element' message when using square brackets
    • Unwanted white spaces when using nested repeating groups
    • Unwanted gap at bottom of table elements
    • Traditional Chinese characters formatting
    • White space at the top of pages
Powered by GitBook
On this page
  1. Troubeshooting

Unwanted white spaces when using nested repeating groups

Previous'Can't find element' message when using square bracketsNextUnwanted gap at bottom of table elements

Last updated 1 month ago

When creating PDFs of long repeating groups (i.e. when the height of the repeating group is > 1 page of the PDF), we recommend using the square bracket approach [] outlined in of the plugin documentation.

However, if you're creating a PDF of a nested repeating group you may still encounter unwanted white spaces.

The solution is to take the square bracket [] approach and apply it to the nested repeating group. This takes a bit of extra work as you will typically have an unknown/variable number of repeating group cells that you need to add to your PDF

Solution

The generatl approach is:

  • Add ID attributes to each of the nested repeating groups

  • Add square brackets ('[' and ']') to each of those nested repeating groups

You can use the 'format as text' and 'split by' operators to get a list of the nested repeating groups. In the example below, I have a repeating group ('menucategory') with a nested repeating group ('menuitem'):

Screenshot 2024-03-26 at 09.34.10.png

I've assigned the ID attribute [menuitem-Parent group's Menu Item's unique id] to the nested repeating group.

Given there are two menucategory repeating groups on this page, we want to be able to dynamically get"

  • [menuitem-uniqueIDxxx]

  • and [menuitem-uniqueIDyyy]

We can use the following dynamic expression to get that:

Where the 'format as text:' is the following:

and we use a comma for the 'split by'.

By adding this expression to our 'Generate PDF Creator' action, we can target all of the relevant nested repeating groups without knowing how many of them there will be.

Screenshot 2024-03-26 at 09.39.21.png

You can see the setup used in the above example .

here
this section