For the complete documentation index, see llms.txt. This page is also available as Markdown.

Information dictionary: adding custom data to a PDF on iOS

To add custom data to an existing document.

// In case you have PDFDoc you can always access
// SDF/Cos document using PDFDoc.GetSDFDoc() method
PTSDFDoc *doc = [[PTSDFDoc alloc] initWithFilepath: filename];
PTObj *trailer = [doc GetTrailer];  // Get the trailer

// Create an Info dictionary
PTObj *info = [trailer PutDict: @"Info"];
[info PutString: @"Producer" value: @"Apryse PDFNet"];

// Create a custom inline dictionary within Info dictionary
PTObj * custom_dict = [info PutDict: @"My Direct Dict"];
[custom_dict PutNumber: @"My Number" value: 100];
// In case you have PDFDoc you can always access
// SDF/Cos document using PDFDoc.GetSDFDoc() method
let doc: PTSDFDoc = PTSDFDoc(filepath: filename, ofType: "pdf")
let trailer: PTObj = doc.getTrailer()  // Get the trailer

// Create an Info dictionary
let info = trailer.putDict("Info")
info.put("Producer", value: "Apryse PDFNet")

// Create a custom inline dictionary within Info dictionary
let custom_dict: PTObj = info.putDict("My Direct Dict")
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.

Last updated

Was this helpful?