# PDF Generation - Google Scripts help

**URL:** https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145
**Category:** Ask for Help
**Created:** [February 2, 2021, 10:52pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145 "2021-02-02T22:52:48Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)
#### Post date: [February 25, 2021, 11:50am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/41 "2021-02-25T11:50:14Z")

</div>

Awesome, thanks for this. What I’m going to be trying to do is create a PDF of a user’s form submissions (rows) over a specified date period (so the PDF would need to find multiple rows dynamically based on a date range and user email).

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [February 25, 2021, 11:52am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/42 "2021-02-25T11:52:00Z")

</div>

make sheet for PDF on separate spread sheets, it will be much easier, and import range data to it

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 25, 2021, 11:55am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/43 "2021-02-25T11:55:21Z")

</div>

Yes, that script I just shared could easily be adapted to do that. There’s actually a companion helper function which iterates through the sheet and decides which rows need to have PDF’s generated. It then calls this function for each qualifying row.

Feel free to reach out if you decide to use it and need some help.

PS. If I was doing this for myself, I’d just use Integromat 😝

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [February 25, 2021, 11:58am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/44 "2021-02-25T11:58:15Z")

</div>

then you will not be able to do cool tricks with it… lol  
did you tried my link?

---

<div class="post-metadata">

### Author: ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)
#### Post date: [February 25, 2021, 11:59am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/45 "2021-02-25T11:59:39Z")

</div>

I’m also considering going that route. The PDF portion of the process isn’t 100% necessary, it’s more of a nice to have, so I’m trying to see if I can make it work without ongoing costs.

I’ll definitely reach out if I need a hand! Thanks!

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [February 25, 2021, 12:01pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/46 "2021-02-25T12:01:12Z")

</div>

if you don’t need PDF, you can make email body look almost like PDF, like in my example

---

<div class="post-metadata">

### Author: ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)
#### Post date: [February 25, 2021, 12:02pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/47 "2021-02-25T12:02:11Z")

</div>

That’s a good point too. Something to consider for sure, especially because it would likely reduce the size of the email too. The cool thing with a PDF is that it’s going to present the same for everyone, regardless of email client or device they’re using. My concern is with folks that are using an email that can’t render the output or HTML nicely. May seem rare, but in my organization, it’s not uncommon to find people with plain text emails only.

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [February 25, 2021, 12:03pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/48 "2021-02-25T12:03:01Z")

</div>

PDF is hosted by link… so it doesn’t take much

---

<div class="post-metadata">

### Author: ![Richard\_Chow](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/richard_chow/32/842_2.png) [@Richard\_Chow](https://community.glideapps.com/u/Richard_Chow)
#### Post date: [February 25, 2021, 12:07pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/49 "2021-02-25T12:07:25Z")

</div>

First time exploring script. By Set trigger you refeting to google sheet right.

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [February 25, 2021, 12:08pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/50 "2021-02-25T12:08:48Z")

</div>

no, to script triggers, that will go of when sheets are edited

---

<div class="post-metadata">

### Author: ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)
#### Post date: [February 25, 2021, 12:56pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/51 "2021-02-25T12:56:02Z")

</div>

I’ve shared this before somewhere in the forum but in regards to PDF creation, we use this and it works well with some of our Glide apps. It’s not free, but it’s been reliable thus far.

[https://workspace.google.com/marketplace/app/document\_studio/429444628321](https://workspace.google.com/marketplace/app/document_studio/429444628321)

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 25, 2021, 1:39pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/52 "2021-02-25T13:39:14Z")

</div>

> [@ehdubya](#):
>
> I’ve shared this before somewhere in the forum but in regards to PDF creation,

Yes, you have. In this very same thread 🤣 🤣

> [@ehdubya](#):
>
> _cough Document Studio cough_
> 
> [https://workspace.google.com/marketplace/app/document\_studio/429444628321](https://workspace.google.com/marketplace/app/document_studio/429444628321)

---

<div class="post-metadata">

### Author: ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)
#### Post date: [February 25, 2021, 2:14pm UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/53 "2021-02-25T14:14:03Z")

</div>

hahaha 🤦🏻‍♂️ I prefaced it for that reason I guess! My bad!

---

<div class="post-metadata">

### Author: ![Richard\_Chow](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/richard_chow/32/842_2.png) [@Richard\_Chow](https://community.glideapps.com/u/Richard_Chow)
#### Post date: [February 26, 2021, 2:57am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/54 "2021-02-26T02:57:07Z")

</div>

thanks Uzo, will give it a try.

---

<div class="post-metadata">

### Author: ![hisashi.fujita](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hisashi.fujita/32/17088_2.png) [@hisashi.fujita](https://community.glideapps.com/u/hisashi.fujita)
#### Post date: [February 26, 2021, 3:26am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/55 "2021-02-26T03:26:23Z")

</div>

1. The user sends text / image from JotForm.  
(JotForm can be replaced with Glide.)
2. Store data in G spreadsheet.
3. Generate PDF with GAS and send the PDF as an attachment to the user by email.  
And …  
A postcard-sized item like this will be delivered to the user.

 ![スクリーンショット 2021-02-26 12.22.49](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/b/eb41a951b651de5ce309d552f32f6c4287a08176.jpeg)

---

<div class="post-metadata">

### Author: ![Manan\_Mehta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manan_mehta/32/13957_2.png) [@Manan\_Mehta](https://community.glideapps.com/u/Manan_Mehta)
#### Post date: [February 26, 2021, 5:11am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/56 "2021-02-26T05:11:46Z")

</div>

Check out these 2 videos for using Apps Scripts for pdf generation:

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/b/3b49c45eeb5013bcf28aaa70a473074395af3d68.jpeg "PDFs from Spreadsheet Data and Google Docs Template - Google Sheets") ](https://www.youtube.com/watch?v=r9uU_KwGgzQ)

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/1/81a17f8bd36edba045686e67f367b7ecce3b9a7f.jpeg "Google Forms to PDF & Email while storing data in Google Sheets") ](https://www.youtube.com/watch?v=EpZGvKIHmR8)

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [February 26, 2021, 8:26am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/57 "2021-02-26T08:26:34Z")

</div>

Will this work upon Glide form submission?

---

<div class="post-metadata">

### Author: ![Mishta\_P](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mishta_p/32/16900_2.png) [@Mishta\_P](https://community.glideapps.com/u/Mishta_P)
#### Post date: [February 26, 2021, 8:28am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/58 "2021-02-26T08:28:20Z")

</div>

The pdf generation @Darren_Murphy built for me is designed to work on form submission, via the “on change” trigger.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 26, 2021, 8:36am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/59 "2021-02-26T08:36:57Z")

</div>

Yes, that’s (sortof) correct. It’s using an onChange() trigger, which means it will fire when Glide makes _any_ change to the Google Sheets.

---

<div class="post-metadata">

### Author: ![Mishta\_P](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mishta_p/32/16900_2.png) [@Mishta\_P](https://community.glideapps.com/u/Mishta_P)
#### Post date: [February 26, 2021, 8:38am UTC](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145/60 "2021-02-26T08:38:39Z")

</div>

I’m doing well with almost correct advice this morning. I’m glad you are there to clear up the mess I am making 🙂

[Previous page](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145.md?page=2)

[Next page](https://community.glideapps.com/t/pdf-generation-google-scripts-help/22145.md?page=4)
