# How to generate a PDF in pdfmonkey.io via Zapier

**URL:** <https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325>\
**Category:** Community Resources\
**Tags:** tutorial\
**Created:** [May 27, 2021, 11:04pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325 "2021-05-27T23:04:13Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)\
**Post date:** [May 27, 2021, 11:04pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/1 "2021-05-27T23:04:13Z")

</div>

I want to premise that the method I am presenting here is currently the only one that I have tested and for which I am sure that it works.  
It is likely that there are better methods than mine; I think that through webhook it is possible to do better than this but I have not yet had the opportunity to experience it.  
In any case, if you want to know how to generate a PDF from your sheet which is the datasource of your Glide application, this tutorial will probably be useful for you.

So let’s get started …

## STEP 1

First, in your APP, you need to be able to assemble a JSON data package formally in the data editor; view and copy the Doc2PDF sample APP to see how to do this.  
So copy this APP and the sheet:  
[https://doc2pdf.glideapp.io/](https://doc2pdf.glideapp.io/)

## STEP 2

In the example APP create a document; this document could be an invoice or an order, or in short any document that is composed of a data header, a foot of data, and a body with a variable quantity of rows.

## STEP 3

Just to do a test to see if the JSON data packet is composed correctly, press the {Copy JSON (just to test it)} button and then paste into an online parser; I for example use this: [http://json.parser.online.fr/](http://json.parser.online.fr/)

## STEP 4

Create your template in [pdfmonkey.io](http://pdfmonkey.io); start from a blank template and use this sections for your experiment with Doc2PDF APP:  
[Pdfmonkey template sections - Google Docs](https://docs.google.com/document/d/1craZ6cjYzFxfALHOU-90pJqdaftwykAeqVOoO-82naE/edit?usp=sharing)  
(This is a slightly adapted version of the existing “Invoice” Master Template)

## If everything is ok, publish it.

## Step 5

Create a new ZAP in Zapier:

> Trigger New spreadsheet Row in Google Sheets

- Setup the worksheet Doc2PDF

> Generate Document in PDFMonkey

- Set up action: in the Dynamic Data (JSON Payload) put the column “Dynamic Data” of your sheet

## STEP 6

In the Doc2PDF APP push the button “Add a row for the trigger” and after some minutes you will have your PDF document generated in documents section of your [pdfmonkey.io](http://pdfmonkey.io)

## STEP 7

What to do next?  
This depends on how you want to use the generated PDF document, for example you could add a subsequent action in Zapier to send it via email to someone, or you could save the generated PDF in your google drive and then capture the link and write back in the original row of your google sheet.

---

<div class="post-metadata">

**Author:** ![mwza](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mwza/32/43529_2.png) [@mwza](https://community.glideapps.com/u/mwza)\
**Post date:** [November 23, 2021, 4:21pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/2 "2021-11-23T16:21:38Z")

</div>

Hi @Roldy Thank you for sharing - I learned alot!

I am working with this solution but using Glide’s Zapier action as the trigger (not a new google sheet row as trigger).  
I have set up my template column and if i copy the results manually into the zap (data in for pdfmonkey action), it works perfectly.

The minute i assign my template column to Glide’s Value 1 and nominate that as the data package in my zap, my zap fails with error: “Unexpected token u in JSON at position 0”.

Do you have any suggestions.  
Sincerely appreciated!

---

<div class="post-metadata">

**Author:** ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)\
**Post date:** [November 23, 2021, 9:02pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/3 "2021-11-23T21:02:41Z")

</div>

I’m pretty sure there is a problem with the payload definition, I don’t remember how I solved it in the past.  
I wrote to technical support, let’s see what they respond.  
However it must work!  
I ask you for a little patience, we will definitely solve it.

---

<div class="post-metadata">

**Author:** ![MIKAHEL](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mikahel/32/25039_2.png) [@MIKAHEL](https://community.glideapps.com/u/MIKAHEL)\
**Post date:** [November 23, 2021, 11:11pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/4 "2021-11-23T23:11:57Z")

</div>

Grande! 🤙🏼

Can I ask you if there is anyway to do the same without use the Monkey (they are better at the zoo 😂 ).  
I currently print PDF using googlescript, but maybe this option it save me to do not execute the trigger, that sometime is causing headhacke!  
Thx for sharing!  
Ciao.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 23, 2021, 11:28pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/5 "2021-11-23T23:28:42Z")

</div>

I don’t think I ever had that problem, isn’t the first character “{”?

---

<div class="post-metadata">

**Author:** ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)\
**Post date:** [November 24, 2021, 12:02am UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/6 "2021-11-24T00:02:39Z")

</div>

Thanks. And yes, now I remember where the problem is.

---

<div class="post-metadata">

**Author:** ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)\
**Post date:** [November 24, 2021, 12:05am UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/7 "2021-11-24T00:05:58Z")

</div>

In Glide remove the leading and trailing braces in the column containing the json.  
In Zapier add the curly brackets manually like this:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/6/b6dd0dc9014a4c44e64e19e24a2b4f127dee580f.png)

---

<div class="post-metadata">

**Author:** ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)\
**Post date:** [November 24, 2021, 12:14am UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/8 "2021-11-24T00:14:12Z")

</div>

Ciao @MIKAHEL  
I may not have understood correctly. Are you looking for another service instead of pdfmonkey to generate PDF?  
Are you creating PDF from apps script code? It’s a bit tiring in my opinion, I chose pdfmonkey because it made it easier for me to define the structure of the document trough html and css.  
But there are other services if you want… or just write some code manually as you did with g.a.s.  
What problems do you have in g.a.s. that cause you headaches?

---

<div class="post-metadata">

**Author:** ![MIKAHEL](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mikahel/32/25039_2.png) [@MIKAHEL](https://community.glideapps.com/u/MIKAHEL)\
**Post date:** [November 24, 2021, 12:20am UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/9 "2021-11-24T00:20:42Z")

</div>

actually the problem is only that sometime it stops for whatever mistake and since Ive other to watch out I prefer not to be in trouble with this.  
But definitely is not a problem, its more a boring thing  
Yes u are right, better to use monkey at the end.

---

<div class="post-metadata">

**Author:** ![Cristiano\_Cruz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cristiano_cruz/32/6394_2.png) [@Cristiano\_Cruz](https://community.glideapps.com/u/Cristiano_Cruz)\
**Post date:** [November 24, 2021, 12:25am UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/10 "2021-11-24T00:25:18Z")

</div>

👏

---

<div class="post-metadata">

**Author:** ![RyanThomas](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@RyanThomas](https://community.glideapps.com/u/RyanThomas)\
**Post date:** [June 4, 2022, 7:26pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/11 "2022-06-04T19:26:58Z")

</div>

Thank you for this tutorial. Very helpful!

---

<div class="post-metadata">

**Author:** ![Ahmed\_Cherifou](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ahmed_cherifou/32/51072_2.png) [@Ahmed\_Cherifou](https://community.glideapps.com/u/Ahmed_Cherifou)\
**Post date:** [January 11, 2023, 7:55pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/12 "2023-01-11T19:55:39Z")

</div>

Thanks a lot Mr Roldy, for this great contribution.

---

<div class="post-metadata">

**Author:** ![thomstove](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thomstove/32/55947_2.png) [@thomstove](https://community.glideapps.com/u/thomstove)\
**Post date:** [April 6, 2023, 8:02pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/13 "2023-04-06T20:02:42Z")

</div>

Thank you so much for your comment, been struggling with this for an hour! Any idea why we need to do this? Looking at the Zap error report, the payload seems to have double {{val1…}} making it invalid JSON. Thanks

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 8, 2023, 10:12am UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/15 "2023-09-08T10:12:28Z")

</div>

> [@RyanThomas](#):
>
> It seems like the free plan does not allow you to load external resources in PDF Monkey and it kept giving me an error. Not sure if it allowed that before

Do you mean external images? I can confirm that it’s only available on paid accounts.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/c/2c8d052c53edb9b839b569aa898c68faace8e141.png)

---

<div class="post-metadata">

**Author:** ![RyanThomas](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@RyanThomas](https://community.glideapps.com/u/RyanThomas)\
**Post date:** [September 10, 2023, 4:45pm UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/16 "2023-09-10T16:45:50Z")

</div>

It looks like thats what it was, I was getting this error message…

 ![Screenshot 2023-09-10 at 9.44.17 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/9/69baec8c0481fae3f4379aaf43581d9428ca7dd6.png)

But it was the external image that was giving it trouble.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 11, 2023, 12:50am UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/17 "2023-09-11T00:50:00Z")

</div>

Yeah, so again, we confirm that the external image was the problem? Is it a dynamic or static image? I’m not sure if using it in data-uri format would make it work on a free account.

> **[Including images in your documents](https://docs.pdfmonkey.io/how-tos/images)**

---

<div class="post-metadata">

**Author:** ![RyanThomas](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@RyanThomas](https://community.glideapps.com/u/RyanThomas)\
**Post date:** [September 11, 2023, 1:59am UTC](https://community.glideapps.com/t/how-to-generate-a-pdf-in-pdfmonkey-io-via-zapier/27325/18 "2023-09-11T01:59:14Z")

</div>

Yeah, external image was the issue. The one that was giving me the issue was a static image that was in his template, but I have dynamic images that I want to use.

I was able to use chatGPT to make a PDF template that works, I think I’m going to pay for the PDF Monkey plan for the month so I can make PDF’s for this short time period I need them.
