Blog post

Import XFDF annotations into PDFs with Nutrient Document Web Services API on Zapier

Hulya Masharipov Hulya Masharipov

This tutorial shows you how to automatically apply XFDF annotations to PDF files using the Nutrient Document Web Services API on Zapier. This is ideal for importing existing annotations, form fields, or values from an XFDF file into PDFs.

Illustration: Import XFDF annotations into PDFs with Nutrient Document Web Services API on Zapier

What is Zapier?

Zapier is a no-code automation platform that connects your favorite apps and services. You can build “Zaps” to automate tasks by setting up triggers and actions between apps like Google Drive, Gmail, and Nutrient.

In this tutorial, you’ll learn how to import XFDF annotation files into PDFs automatically using the Nutrient API.

What is the Nutrient API?

Nutrient Document Web Services API enables powerful document automation tasks, including converting, annotating, extracting, signing, or securing PDF files. With your free account, you get 100 credits to try any of the 30+ tools available.

What you’ll need

  • A Zapier account (a pro plan is necessary for multi-step Zaps)

  • A Google Drive account

  • A PDF file stored in a drive folder

  • A corresponding .xfdf file in a drive folder

  • A Nutrient API key — sign up here

Step 1 — Trigger a new file in a Google Drive folder

  1. Select Google Drive as the trigger app.

Select Google Drive as the Zap trigger

  1. Choose the New File in Folder trigger event.

Choose ‘New File in Folder’ trigger event

  1. Connect your Google Drive account.

  2. Configure the trigger:

  • In the Drive field, select your Google Drive.

  • In the Folder field, select or create a folder (e.g. xfdf-import/input).

Google Drive folder selected as the input folder

  1. Test this step with a sample .pdf file.

Zapier test showing detected PDF file

Step 2 — Find the XFDF file in Google Drive

  1. Add a new step: Google Drive > Find a File.

Google Drive ‘Find File’ action

  1. Configure the search:

    • Filename — Use a static or dynamic name (e.g. annotations.xfdf)

    • Search TypeFilename contains

    • Drive — Select your personal drive

    • Folder — Point to where you store XFDF files

Configure the Find File step for XFDF file

Ensure the XFDF file sharing is set to Anyone with the link can view so it’s accessible to the API.

  1. Test the step to confirm the XFDF file is retrieved.

Test result showing XFDF file located

Step 3 — Import XFDF into PDF (Nutrient API)

  1. Add Nutrient Document Web Services API as the app.

Select Nutrient API for the XFDF import step

  1. Choose Import XFDF to PDF as the action.

Choose XFDF Import API action

  1. Connect your Nutrient API account using your API key.

Paste API key for authentication

You can get your API key from the Nutrient dashboard.

Where to find your Nutrient API key

  1. Configure the action:

    • PDF File URL — Use the output from step 1.

Map the PDF and XFDF URLs in action config

  • XFDF File — Use the output from step 2,

Map the PDF and XFDF URLs in action config

  • Output File Name — Optional (e.g. annotated_report.pdf)

You can use our sample PDF document and sample XFDF file for testing.

  1. Test the action to ensure the annotations are correctly applied.

Run test to verify XFDF annotations were imported

Step 4 — Upload the annotated PDF to Google Drive

  1. Add Google Drive as the final step and choose Upload File.

Final action step: Upload File to Drive

  1. Select the drive and folder where the annotated file should be saved.

  2. In the File field, use the result from the previous Nutrient step.

Map the output from XFDF import to the upload step

Upload to a different folder to avoid Zap loop warnings.

  1. Test this step to confirm the final file uploads successfully.

Test showing successful PDF upload after XFDF import

Conclusion

You’ve just built a Zap that automatically imports XFDF annotations into PDFs using the Nutrient API. This is perfect for workflows where annotations are stored in separate XML-based XFDF files and need to be merged into PDFs.

Extend this workflow with tools like flattening, signing, or OCR to create even more powerful automations.

Author
Hulya Masharipov
Hulya Masharipov Technical Writer

Hulya is a frontend web developer and technical writer at Nutrient who enjoys creating responsive, scalable, and maintainable web experiences. She’s passionate about open source, web accessibility, cybersecurity privacy, and blockchain.

Free trial Ready to get started?
Free trial