Add and retrieve custom properties from PDF

Q: I’m trying to determine if the SDK will allow us to read custom properties in the PDF file such as below. I did not see anything directly in the API, but I may be missing something.


Yes you can add and retrieve custom properties like this. Adobe is adding these custom properties to the “Info” dictionary, along with “Title”, “Author”, etc. Hence why there is the warning at the bottom of the dialog.

The following python code demonstrates how to find a custom document property.

keysToIgnore = {“Title”:True, “Author”:True, “Subject”:True,

“Keywords”:True, “Creator”:True, “Producer”:True,

“CreationDate”:True, “ModDate”:True, “Trapped”:True}

doc = PDFDoc(inputpath);


info = doc.GetTrailer().FindObj(“Info”)

if info:

itr = info.GetDictIterator()

while itr.HasNext():

key = itr.Key().GetName()

value = itr.Value()

if key not in keysToIgnore:

print(key + " : " + value.GetAsPDFText())


Also, see this forum posting on how to add your own custom property using PDFNet.