Accessing Custom Document Properties

28 views
Skip to first unread message

cba...@teambizwiz.com

unread,
May 16, 2018, 2:12:12 PM5/16/18
to PDFTron WebViewer
Is there any way using the pdftron.PDF.PDFDocInfo methods to access the custom properties keyvalue pairs or am I limited to putting them as comma delimited keywords within the Keywords document properties.

David Tippett

unread,
May 17, 2018, 7:58:31 PM5/17/18
to pdfnet-w...@googlegroups.com
Hello, 

You should be able to use docInfo.getSDFObj() to obtain the SDF/Cos low-level info object. From there you can get the value of your custom property. 

Here is some PDFNetJS full code.
var docInfoObj = yield docInfo.getSDFObj();
var customPropObj = yield docInfoObj.findObj("myCustomProperty");
// Note the next statement assumes customPropObj is a String Obj.
// Use other functions such as getBool, getNumber, getName etc. to get the value
// of other object types
var customPropString = yield docInfoObj.getAsPDFText();

PDFNet on your server can also access the custom property in a similar manner.

David Tippett
Senior Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages