Information dictionary: adding custom data to a PDF on iOS

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
3PTSDFDoc *doc = [[PTSDFDoc alloc] initWithFilepath: filename];
4PTObj *trailer = [doc GetTrailer]; // Get the trailer
5
6// Create an Info dictionary
7PTObj *info = [trailer PutDict: @"Info"];
8[info PutString: @"Producer" value: @"Apryse PDFNet"];
9
10// Create a custom inline dictionary within Info dictionary
11PTObj * custom_dict = [info PutDict: @"My Direct Dict"];
12[custom_dict PutNumber: @"My Number" value: 100];

Cos/SDF low-level API to edit PDF files
Full code sample which illustrates how to use basic Cos/SDF API to edit an existing document.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales
Add Custom Data to PDF Documents in iOS | Apryse documentation