Skip navigation
ecm-Vottero
Currently Being Moderated

Using "calculate" in Acrobat Form to display document metadata (Author, etc.)

Apr 2, 2012 8:49 AM

Tags: #javascript #acrobat-forms #calculate #acrobat_10_pro

Can someone assist with a javascript that will retrieve the document "Subject" or "author" so that I can use that data on an acrobat form?  (I am creating a form that will then be inserted as the first page in an existin adobe document and I want the form to display details about that document.

 
Replies
  • George Johnson
    11,668 posts
    Aug 11, 2002
    Currently Being Moderated
    Apr 2, 2012 9:12 AM   in reply to ecm-Vottero

    You probably don't want to use the calculate event, as it is triggered only when a field value changes. You can place someting like the following in the initial page's Page Open event:

     

    getField("SUBJECT").value = info.Subject;

     

    For more information, see: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_A croJS.88.396.html

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 9:20 AM   in reply to ecm-Vottero

    The document title and author are contained in the document object's 'info' property.

     

    // display the info items in the JavaScript console.

    for (var i in this.info)

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

     

    There is also a 'metadata' property for the document object, but this is much harder to process.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points