SetaPDF Demos

There seems to be a problem loading the components. Please check your PHP error logs for details!

Common issues could be that you missed to install the trial license or that you are using a trial version on an unsupported PHP version.

Add TDM Reservation Protocol (TDMRep) Properties

This demo shows you how you can add some special metadata to your PDFs to block AI models from scraping your PDFs.

These entries are defined in the TDM Reservation Protocol (TDMRep) specification which most recent version can be found here.

Note: You need to create and host your own policy file.

PHP
<?php

use setasign\SetaPDF2\Core\Document;
use setasign\SetaPDF2\Core\Writer\HttpWriter;

// load and register the autoload function
require_once '../../../../../bootstrap.php';

$writer = new HttpWriter('Fact-Sheet-TDM.pdf', true);
$document = Document::loadByFilename($assetsDirectory . '/pdfs/camtown/Fact-Sheet.pdf', $writer);

$ns = 'http://www.w3.org/ns/tdmrep/';
$alias = 'tdm';

$info = $document->getInfo();

$xmp = $info->getXmp();
$xmp->xmlAliases[$ns] = $alias;

$info->updateXmp($ns, 'reservation', 1);
$info->updateXmp($ns, 'policy', 'https://www.example.com/policies/tdm-policy.json');
$info->syncMetadata();

$document->save()->finish();