PDF & Screenshot Pro - saving to DB?

Can anyone see what I am doing wrong? I want a button to screenshot page, create PDF and save that PDF to DB.

I check ‘Save to Bubble’

My Invoice Datatype has a ‘PDF’ field where I want to store the invoice’s PDFs.

And I ‘think’ I am saving it correctly but nothing is going to the DB?

try saving the in same workflow.

use result of maybe might work

I can’t, the ‘PDF/IMG A Page Saved’ function is an event and is not available in a normal workflow so it has to be seperate.

Wait … it is saving to my File Manager, but how do I get it into the DB ‘PDF’ field?!

Hey did you find a solution for this problem?

No I didn’t :frowning: I just allow the user to download the PDF but don’t see any way to save it to the DB.

You are saving it correctly. For me it first didn’t work. Then I thought it works because it’s filling the field. But it’s the wrong file…

@renatoasse May you help, please?

Just check the “Save to Bubble” field, and use the Saved event to create a new thing in your database:

1 Like

That’s what I did. Sometimes it saves, sometimes not. And when it saves it most of the times saves the file file that was created before…

Can you share the editor link?

Can you share the editor link?

@flyhigh I also struggled with this one. My solution

  1. The save event only triggers after it has has successfully saved (as described in the saved documentation (checkbox) )
  2. Create another workflow to deal with the “save” event https://bit.ly/3SCeMfK and set it up based on the type of pdf generation you setup. (page, element, image). In my case it was element https://bit.ly/3vO1R0w

Basically you got two workflows. One that generates the PDF and another that triggers automatically after the save.

Hope that helps

3 Likes

Thank you so much @donovanmat.76 – with your screenshots it made it clear to me. I had it as a workflow step and that didn’t work. With an extra workflow it’s fine now. Spent hours with this yesterday. So really thank you.

Also thank you @renatoasse for the plugin and willing to take the time to have a look.

1 Like

@donovanmat.76 @flyhigh

Have you encountered such a problem? How do I solve this problem at the bottom of the page?

Is that a PDF? If so, maybe the image is on the threshold between two pages, try moving the image up or down.

Yes it is a pdf. This is a repeating group. The 2nd condition in the picture temporarily solves it for the first page, but the 3rd or 4th page may still have the same problem. So I need to do something like condition 1 in Picture. I think I need to do a calculation based on the Y coordinate of the cell in Rg, but I haven’t yet found a way to find the Y coordinate of an element on the page.

This is an interesting problem I am also facing, the question is how to ensure the Bubble page matches the height of the PDF pages. Would be great if someone had a solution because if you have your heights off by a small amount, the error mounts up so on PDF page 10, for example, you start to get out of sync with page heights.

It may be worth starting a new thread on this topic alone?

I fixed the length of the cell in the Repeating Group. Since the first page has a header at the top, the number of cells that will fit on the first page will be different from the other pages (as my other pages have nothing but Rg). That’s why I put the 2nd condition in the picture to add margin at the end of the 1st page. Since the other pages contain 6 cells, I have added a margin condition to the 6th cells (1st condition in the picture).

In order not to waste any more time, I solved it this way.

If you use this method, you should change the index and margin values according to your own pdf content.

Glad you solved it and thank you for the tip about changing the index and margin values

I have been playing around and wanted to share the answer to how to get a pdf height and width set correctly.

A4 page is:
210mm wide = 793.70px
297mm high = 1122.51px

If you feel your dimensions are different, to get the exact height of a PDF page in pixels, you can:

  • Open the PDF file that you want to measure in the PDF viewer application.
  • Go to the “File” menu and select “Properties” or “Document Properties.”
  • In the Properties window, select the “Description” tab.
  • Look for the “Page Size” section, which will show you the dimensions of the PDF page in points (1 inch = 72 points).
  • Note down the height measurement in points.
  • Convert the height measurement from points to pixels, which is the unit used in Bubble.io. You can use an online converter to do this, such as Convert Millimeter to Pixel (X)
  • Once you have the height measurement in pixels, you can set the height of your Bubble groups accordingly. Keep in mind that the height may vary slightly depending on the printer or PDF viewer settings used, so you may need to do some testing and adjustments to ensure the information is correctly displayed on each page of the printed PDF.
1 Like