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
3SDFDoc doc = new SDFDoc(filename);
4Obj trailer = doc.GetTrailer(); // Get the trailer
5
6// Create an Info dictionary
7Obj info = trailer.PutDict("Info");
8info.PutString("Producer", "Apryse PDFNet");
9
10// Create a custom inline dictionary within Info dictionary
11Obj custom_dict = info.PutDict("My Direct Dict");
12custom_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