Are you looking for an efficient way to add text to your PDF documents? With the help of Google Apps Script and PDF.co integration, you can automate the process of adding text (or any other content) to your PDFs.
In this tutorial, we will show you how to use these powerful tools to edit your PDFs step-by-step. We’ll start by showing you how to set up Google Apps Script and PDF.co, and then we’ll walk you through the process of adding text to your PDFs using code.
Whether you’re a business owner looking to streamline your document workflow or an individual looking to make quick edits to your PDFs, this tutorial will provide you with the information you need to get started. So let’s begin!
In this guide, we will show you how to Add text to PDF using Google Apps Script and PDF.co using these 6 steps:
- Google Sheets App
- Add API Key, Sample PDF, Input Text, and Result Path
- Google Apps Script Code
- Run App Script
- Finish App Script
- Check the Output
- About Google Apps Script
- Video Guide
We will use this sample PDF in this tutorial. You may use a PDF of your choice.
Step 1: Google Sheets App
- To begin. First, open the Google Sheets app.
Step 2: Add API Key, Sample PDF, Input Text, and Result Path
- Next, add the PDF.co API Key, you can get the API Key in your PDF.co dashboard.
- Then, input the sample PDF URL and the Text you want to add to the PDF.
- Enter a path where the output link will be added.
- Finally, click on the Extensions button and select the App Script.
Step 3: Google App Script Code
Now, let’s add the code and set up the Google App Script
- First, add the Google App Script code. You can get the code at this link.
- In line 20, add the cell where the PDF.co API Key is located.
- For lines 23 and 25, add the cell where the sample PDF URL, Input text, and Result are located.
- For line 38, add the coordinates, font style, font name, font size, and font color of the text. You can easily collect the x and y coordinates of the PDF document using the PDF Viewer tools.
Step 4: Run App Script
- Once you’re done, you may now run the code.
Step 5: Finish App Script
- Once the execution is completed, go back to Google Sheets and click PDF.co. Then click Create PDF. You will then be given a temporary link where you can view and download the output PDF.
Step 6: Output
- Here’s what the output PDF looks like.
In this tutorial, you learned how to add text to PDF using PDF.co and Google App Script. You also learned how to get specific coordinates of the document using the PDF Viewer tools.
Summing up, adding text to a PDF using Google Apps Script and PDF.co is a straightforward process.
- First, enable add PDF.co API key in your Google Sheets app.
- Next, use the provided code examples and set up the function that will add text to the PDF.
- Once you have set up the function and added the appropriate parameters (such as coordinates, font style, font name, font size, and font color), you may add the desired text to the PDF.
- Run the script and get your link to download the result.
About Google Apps Script
This script can be used to automate repetitive tasks, create custom formulas and validations in Google Sheets, send automated email responses, and more. Google Apps Script can also be used to create web apps and web-based forms that can be used within and outside of an organization.
Additionally, Google Apps Script can be connected to other services using Google’s built-in connectors and the Google Script Services to read or write data to other APIs, and also can be used to create Add-ons for Google Suite products like Sheets, Docs, and Forms. This makes it a powerful tool for organizations and individuals looking to streamline and automate their workflows.
Video Guide for Adding Text to PDF
Here’s a video guide showcasing how to add text to PDF using Google Apps Script and PDF.co.
- How to Password-Protect PDF in Google Drive with Google Apps Script and PDF.co
- How to Split PDF in Google Drive Folder with Google Apps Script and PDF.co
- How to Merge PDF URLs with Google Apps Script and PDF.co
- How to Add Text to PDF using Google Apps Script and PDF.co
- Merge Google Drive PDF Files and Save Them Back using Google Apps Script and PDF.co
- How to Add Image to PDF using Google Apps Script and PDF.co
- Google Invoice Parser to Read PDF Invoices and Orders with Google Script and PDF.co
- Convert PDF Invoice to Google Sheet – PDFco & Google Apps Script
- How to Merge all Rows to PDF with Google Apps Script and PDF.co