Information dictionary: adding custom data to a PDF on Server/Desktop

To add custom data to an existing document.

1// In case you have PDFDoc you can always access
2// SDF/Cos document using PDFDoc.GetSDFDoc() method
3$doc = new SDFDoc($filename);
4$trailer = $doc->GetTrailer(); // Get the trailer
5
6// Create an Info dictionary
7$info = $trailer->PutDict("Info");
8$info->PutString("Producer", "Apryse PDFNet");
9
10// Create a custom inline dictionary within Info dictionary
11$custom_dict = $info->PutDict("My Direct Dict");
12$custom_dict->PutNumber("My Number", 100);

Cos/SDF low-level API to edit PDF files - Full Sample
Full code sample which illustrates how to use basic Cos/SDF API to edit an existing document. Samples available in Python, C# (.Net), C++, Go, Java, Node.js (JavaScript), PHP, Ruby, VB. To use this code, you'll need to download and get started with Server SDK.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales