PDF Exporter in Retool

Hi, Afaq Here. I'm a Retool Developer and I just trying to create a pdf by using PDF Exporter but I'm only able to write text and adjust its font size using # before writing Text. It will make sense if you add a rich text component and some other feature that will made easier while creating PDF Document

2 Likes

hey @afaq_mehmood idk what all you have in mind, but you can totally put images or any other markdown in your pdf:

Just an FYI in case it's of interest @afaq_mehmood - I've had a lot of success making very good looking PDFs using Retool and https://hybiscus.dev/ (no affiliation beyond being a paying customer). I'd create JSON in the Retool App and submit to the Hybiscus API, then poll until ready to download and then grab it and display it. It gave me a lot of flexibility and formatting options.

2 Likes

+1

Currently, the only way to do this is through a custom module leveraging a HTML to PDF exporter JS library (a bit hacky) or an API service (potentially costly).

Would be great to have a native way of doing this. If we can export Markdown to PDF, surely it's feasible to provide the option to export HTML too.

2 Likes

Can you explain to me how to insert an image into the pdf? I've tried several ways to have a signature block and queries that save that image as a jpg and then insert it into the pdf generator with no luck. I've even tried with just an image that was saved in the retool database and it still keeps returning [object object]

1 Like

we have fully integrated CraftMyPDF into our retool application, it works really well once you have your templates setup. I would recommend it if you need to automate the creation of PDF documents. We use it to automatically complete sales quotes and merge with product datasheets to give the sales staff a complete customer ready quote on the fly. https://app.craftmypdf.com/

2 Likes

@ndintino hey sorry for the delay!

honestly, i don't know the best way to get an image into PDF from something like a file or URL, but in those screenshots about I used base64-encoded data from the first image we ever uploaded.

maybe try this for local storage?

const base64 = await utils.getDataByObjectURL(imageInput1.value[0])

from How do I get the Base64 of a file created with ImageInput - #2 by bca

there's also this Retool demo app

Here is the post were we used Markdown to add an image to the PDF: