Part 2: Protecting Your PDFs from AI Scraping with Datalogics’ New Code Samples
Member NewsJune 12, 2025
Member NewsJune 12, 2025
About Patrick Gallot, Datalogics
The views expressed in this article are those of the author(s) and do not reflect the policies or positions of the PDF Association.
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:
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 has spent nearly 30 years helping software companies and enterprise teams build, automate, and scale document workflows through Adobe-powered PDF technology. Our flagship Adobe® PDF Library gives developers full-spec PDF creation, editing, rendering, conversion, and processing, available for Adobe C/C++, Modern C++, .NET, .NET Framework, and Java, with SDK,…
Read more



