PDF Association logo

Discover pdfa.org

Key resources

Get involved

How do you find the right PDF technology vendor?
Use the Solution Agent to ask the entire PDF communuity!
The PDF Association celebrates its members’ public statements
of support
for ISO-standardized PDF technology.

Member Area

Part 2: Protecting Your PDFs from AI Scraping with Datalogics’ New Code Samples

June 12, 2025
This article explains the application of Datalogics’ Adobe PDF Library to express TDMRep in a PDF to protect your data from AI scraping.
Patrick Gallot
About Patrick Gallot

Patrick Gallot, has been working with software developers and PDFs since 2000. At Datalogics, he is the lead technical support Engineer for the Adobe PDF Library and Datalogics PDF Java Toolkit, helping our customers resolve their complex questions and challenges. He is also active in the PDF community, presents at … Read more


Using Adobe PDF Library to express TDMRep in a PDF

This is a follow-up from our previous article, Defending Your PDFs: Blocking AI Models from Scraping Your Data. In this article, we will show you how to use DataLogics' Adobe PDF Library to express TDMRep in a PDF to protect your data from AI scraping.

For this example, we are going to be using Adobe PDF Library’s .NET interface. Here is a simple example created by Datalogics:

Example created by Datalogics

We need to affect the XMP metadata to express the properties “reservation” and “policy” under the namespace “http://www.w3.org/ns/tdmrep/”. APDFL’s Document class has a member we can use to set an XMP Metadata property, aptly named SetXMPMetadataProperty(). That might look like this:

doc.SetXMPMetadataProperty(tdmNS, "tdm", "reservation", "1");  doc.SetXMPMetadataProperty(tdmNS, "tdm", "policy", "http://www.test.com/some_tdm_policy");  

Where “doc” is a Document object, “tdmNS” is shorthand for the aforementioned W3C namespace, and “tdm” is the property prefix in XML. Ultimately this should end up adding XMP metadata properties to the PDF similar in appearance to those in the XML screenshot from earlier in this article.

The Datalogics .NET sample application can be found here. 

APDFL’s Java and C++ interfaces have equivalent functions: Document.setXMPMetadataProperty() and PDDocSetXAPMetadataProperty(), respectively.

In addition to the sample application above, Datalogics also offers a sample application that will extract text from a PDF and print TDMRep metadata to the Console. It does this simply by checking for the relevant properties in the PDF’s XMP metadata using a JSON parser to return the contact information of the rightsholder. That application can be found here: https://github.com/datalogics/additional-apdfl-csharp-dotnet-samples/tree/develop/TextExtractTDMAware.

To address AI scraping challenges with your PDFs, download a free trial of Adobe PDF Library today, or contact us to learn more.


Datalogics, Inc. provides a complete SDK for PDF creation, manipulation and management for companies around the globe. Built on Adobe source code, our flagship product Adobe® PDF Library offers a choice of programming platforms and languages along with unsurpassed customer service, proven by our 94% customer retention rate. Datalogics offers…

Read more
WordPress Cookie Notice by Real Cookie Banner