How to create PDF certificates with Google Sheets

Google Sheets and PicsAPI.com make it easy to create and format your certificates so that they look their best. Here's a step-by-step guide on how to create PDF certificates with Google Sheets and PicsAPI.

PDF certificates are a great way to show recipients their accomplishments in a professional and stylish way.

Google Sheets and PicsAPI.com make it easy to create and format your certificates so that they look their best. Here's a step-by-step guide on how to create PDF certificates with Google Sheets and PicsAPI.

Prerequisites

Video Tutorial

Written Tutorial

Let's take the following example. So you just organized an event or training, and now you need to issue hundreds of certificates to people.

There are many ways to go about it. One way is to have someone type in manually in Word or any text processor, hundred times, and then send that manually to everybody that was there.

And another way is to use an automated tool like PicsAPI.com to do that automatically for you. So here I just created a template for a certificate with a name and the date.

And as you can see, we have two dynamic layers. Name and date.

Now, let's head over to Google Sheets, in this document we have the names of people and the date on which they attended the training.

Now in order to create the certificate with PicsAPI's service, we need to create a custom function that we will call:

getCertificate()

For that, we will use Google App Script.

If you're not familiar with App Script, please check this quick introduction by Google.

Once you've done that, you can then create the following code in your Google Sheet project.

If you are familiar with JavaScript, it should be pretty straightforward.

function getCertificate(name, date) {
//=getCertificate(B2,C2)
  var formData = {
    transformations: {
      date:{text:date},
      name:{text:name}
    },
    template_id:'<template-id>',
    format:'pdf'
  }

  var options = {
    'method': 'post',
    'contentType': 'application/json',
    'payload': JSON.stringify(formData),
     muteHttpExceptions: true,
  }

  console.log(options);

  let api_key = '<api-token>';

  options.headers = {"Authorization": "Bearer " + api_key};


  var response = UrlFetchApp.fetch('https://api.picsapi.com/v1/make', options);

  var responseCode = response.getResponseCode()

  console.log(response.getContentText());

  if(responseCode != 200) {
    return false;
  }
  else {
    var data = JSON.parse(response.getContentText());
    console.log(data);
    return data.data.url;
  }

}

Now that our function is ready, it is available in our Google Sheet document. We can just go ahead and write the name of the function, and the required parameters B2 (name) and C2 (date) and wait for the certificate to get generated.

Once it is ready a link will appear in the cell.

This link will take us to the generated PDF.

And now you can see we have all the information that we entered in our certificate.

Now, we can do the same thing for every user in our sheet.

💡
Please note that Google has limitations when it comes to API calls. The limit is between 30-60 requests per minute. 

Conclusion

In conclusion, generating PDFs from Google Sheets using the PicsAPI.com' API is a simple and effective process.

PicsAPI provides an easy-to-use API that allows users to quickly and easily generate PDFs and images from various sources.

The process is quick and easy, and the results are high-quality PDFs that can be used for a variety of purposes, not only certificates.