๐Ÿ“„ HTML to PDF from any template! (Tutorial)

:waving_hand: Hey fellow Gliders!

One of the most tedious things to do in Glide is build out PDF generation functionality.

Glide does provide a couple integrations like PDF Monkey (canโ€™t add dynamic line items) and Docs Automator (more on the expensive side), but I wanted to share with you a method that Iโ€™ve used several times using PDF.co โ€” in less than hour!

Itโ€™s relatively inexpensive (~1800 pages for $10/mo) and has a fast, easy API to work with.

Check out the video tutorial below where I cover:

  • Converting an existing template (PDF/image/text) into HTML/JSON
  • Creating a PDF.co template with the HTML/JSON
  • Creating the corresponding JSON data in Glide
  • Generating the PDF [url] via PDF.co API and storing it as a Glide URL
  • Displaying, opening, and sharing the PDF within Glide

The video below uses the context of an invoicing app, but you can create any type of PDF with this method (contracts, reports, proposals, rosters, inventory, logs, etc.)

:popcorn: Enjoy!

7 Likes

You actually can, using for loop.

I think he meant using the integration (it canโ€™t parse the JSON correctly and sending it over as text).

In those cases, you can use this:

{% assign parsed_data = data | parse_json %}

With data being the JSON data you send over using the integration.

parsed_data will be your JSON object to work with.

1 Like

Correctโ€” I meant the integration.

Believe it or not, I recorded two hours worth of video content on how to do this exact same thing using PDF monkey instead of pdf.co,

I had to scrap it because it got way too complicated at the end when I realized that PDF monkey returns a preview URL and not the actual URL to the PDF which required a separate Webhook listener.

3 Likes