Getting the file size of a PDF
You can get the file size of PDFs generated by PDF Potion by modifying the backend workflow you use to link a PDF to an entry in your database.
- Add a number field to your ‘Report’ data type (or whatever custom data type you’re using)
- Add a key called ‘size’ to the backend workflow you’re using to process the PDF
- This key returns the size of the PDF in bytes
- Save the value returned by the ‘size’ key to your ‘Report’ data type. In this example, I’ve divided the value by 1,000 so that I have the value in KBs
Note: There can be a small difference in the file size value returned by PDF Potion vs. what you’ll see in the ‘File Manager’ section of your Bubble database. However, when you download the file to your computer, the file size matches the PDF Potion value (not the Bubble File Manager value).