Automatically Add Watermarks to PDFs in Google Drive Using n8n and PDF.co

6 Minutes Read

This workflow monitors a Google Drive folder, adds a text watermark to each new PDF with PDF.co, and saves the processed file in another Drive folder.

The workflow is:

Google Drive Trigger → Download PDF → Upload to PDF.co → Add Watermark → Download Result → Upload to Google Drive

Prerequisites

Prepare:

  • An n8n instance
  • A PDF.co account
  • Google Drive credentials in n8n
  • An input folder for new PDFs
  • A separate output folder for watermarked PDFs

Using the JSON Workflow

The PDF.co node is a community node and must be installed before importing the JSON workflow.

In n8n:

  1. Open Settings → Community Nodes.
  2. Search for n8n-nodes-pdfco.
  3. Install the package.
  4. Reload the n8n editor.
  5. Import the workflow JSON.

After importing, select your Google Drive and PDF.co credentials and update the input and output folders. See the PDF.co node package for installation details.

You can also build the workflow manually using the steps below.

Step 1: Prepare the Google Drive Folders

Create two folders:

  • INPUT_FOLDER for PDFs awaiting processing
  • OUTPUT_FOLDER for completed PDFs

Keeping them separate prevents processed files from triggering the workflow again.

Step 2: Add the Google Drive Trigger

Add Google Drive Trigger and configure it to watch INPUT_FOLDER for newly created files.

Connect your Google Drive account and test the trigger with a sample PDF. The result should include the file ID and filename.

Step 3: Download the PDF

Add a Google Drive node after the trigger.

Configure it to download the file:

  • Operation: Download
  • File ID: Map the ID from the trigger
  • Binary Output Field: data

This provides the actual PDF file rather than a Drive preview link.

Step 4: Upload the File to PDF.co

Add PDF.co API and select Upload File.

Configure the node:

  • Binary File: True
  • Input Binary Field: data
  • File Name: Map the original Google Drive filename

The node uploads the PDF securely and returns a temporary PDF.co URL.

Step 5: Add the Watermark

Add another PDF.co API node and select Add Text/Images to PDF.

Map the URL returned by the upload node into the source URL field.

Add this text annotation:

{
  "text": "CONFIDENTIAL",
  "x": 105,
  "y": 412,
  "size": 100,
  "color": "#662563EB",
  "fontBold": true,
  "fontName": "Arial",
  "alignment": "center",
  "pages": "0-"
}

The color uses AARRGGBB format. 66 adds transparency, while 2563EB defines the blue color.

Use 0- to apply the watermark to every page. Adjust the coordinates and font size for your document layout. PDF.co’s PDF Edit Add Helper can be used to determine suitable coordinates.

Set the output filename to the original filename or another descriptive value.

Step 6: Download the Watermarked PDF

Add an HTTP Request node:

  • Method: GET
  • URL: Map the URL returned by the watermark node
  • Response Format: File
  • Binary Output Field: data

This downloads the processed PDF into n8n as binary data.

Step 7: Save the PDF to Google Drive

Add Google Drive and select Upload.

Configure the node:

  • Input Binary Field: data
  • File Name: Watermarked_ followed by the original filename
  • Folder: Select OUTPUT_FOLDER
  • Drive: Select the appropriate Google Drive

Step 8: Test and Activate the Workflow

Run the workflow and upload a sample PDF to INPUT_FOLDER.

Confirm that PDF.co adds the watermark and that the processed file appears in OUTPUT_FOLDER. Once the test succeeds, activate the workflow.

Conclusion

You now have an automated n8n workflow that securely downloads new Google Drive PDFs, adds a watermark with PDF.co, and saves the finished files to a separate Drive folder.

Next Steps

You can enhance this automation further by:

  • Sending an email notification once watermarking is complete.
  • Logging processed file names in a Google Sheet.
  • Using variables like upload date, user name, or document type in your watermark text.

Built something amazing? Share your workflow and tag us @pdfdotco — we’d love to feature your automation!

Related Tutorials

See Related Tutorials