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

Information dictionary: adding custom data to a PDF in Android

To add custom data to an existing document.

// In case you have PDFDoc you can always access
// SDF/Cos document using PDFDoc.GetSDFDoc() method
SDFDoc doc = new SDFDoc(filename);
Obj trailer = doc.getTrailer(); // Get the trailer

// Create an Info dictionary
Obj info = trailer.putDict("Info");
info.putString("Producer", "Apryse PDFNet");

// Create a custom inline dictionary within Info dictionary
Obj custom_dict = info.putDict("My Direct Dict");
custom_dict.putNumber("My Number", 100);
// In case you have PDFDoc you can always access
// SDF/Cos document using PDFDoc.GetSDFDoc() method
val doc = SDFDoc(filename)
val trailer = doc.trailer  // Get the trailer

// Create an Info dictionary
val info = trailer.putDict("Info")
info.putString("Producer", "Apryse PDFNet")

// Create a custom inline dictionary within Info dictionary
val custom_dict = info.putDict("My Direct Dict")
custom_dict.putNumber("My Number", 100.0)

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?