These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Is there a way to retrieve Custom document properties?

michael666
Registered: Jun 25 2009
Posts: 12
Answered

I have a PDF document with serveral custom document properties. Is there a way in the javascript api to retrieve the values of the custom properties? I have searched and have not found a way.

Thx

My Product Information:
Acrobat Pro 9.1.1, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You can use the 'doc' object's 'info' property to set and read some of the document's properties, including the creation and reading of custom properties.

You can use:

for (var i in this.info)
console.println(i + ": "+ this.info[i]);

To list the property name and value for the properties of a PDF.

The following code:

var docTitle = this.info.Title;
this.info.Title = "JavaScript, The Definitive Guide";
this.info.ISBN = "1-56592-234-4";
this.info.PublishDate = new Date();

Will add the custom properties of 'ISBN' with a value of "1-56592-234-4" and 'PublishDate' with the current date and time and set the standard property 'Title' witha value of "JavaScript, The Definitive Guide".

More infromation is in the Acrobat JS API Reference.

George Kaiser

michael666
Registered: Jun 25 2009
Posts: 12
Excellent! Thank you for the speedy reply.