1

I'm creating a dynamic stamp in Acrobat to capture meta-data defined in the Document Properties/Custom Properties tab. Each reviewer can modify their portion of the meta-data, then when they use the dynamic stamp the data is 'captured' and displayed in the non-editable dynamic stamp. This stamp then travels with the PDF and is the visible and printable contract data used to place a printing order. There are approximately seven custom properties. I have been able to create the stamp, but don't know what to include in each form field's calculation to capture and display the meta-data. In English, I want the dynamic stamp to 1)get the named meta-data from the document's custom properties, 2) populate this form field with those text/numbers, 3) complete the dynamic stamp creation.

Using Adobe Acrobat DC in common workplace environment, primarily PC but some Mac. I've dug in to the ,JavaScript for Acrobat API Reference' which is a nice collection of ingredients and nearly no context for a non-programmer to accomplish much of anything. :-)

Expected result: When the reviewer applies the dynamic stamp, all seven form fields are populated with the custom property information within the PDF.

BStone
  • 111
  • 4

1 Answers1

0

The short and direct answer to the question is to put the following code into the custom calculation action of a field in the stamp. For a custom property "foo" it would be...

event.value = event.source.source.info.foo;

event.source is the PDF file that represents the stamp.

event.source.source is the PDF file the stamp is being applied to which is where you want to pull the custom metadata (info) from.

This will work, however, you might want to add a bit more JavaScript in the stamp to ensure that the script only fires when the stamp is being placed and not when it's being rendered into the Acrobat UI. See the following long(ish) article on how to set that all up.

https://acrobatusers.com/tutorials/dynamic_stamp_secrets

joelgeraci
  • 4,606
  • 1
  • 12
  • 19
  • Thank you @JoelGeraci. I'm familiar with the link you shared; no doubt it's very helpful for some. It's jibberish to me. I've tried to parse it out along with related posts from the same author. 1) How does your line differentiate between the seven-or-so different custom properties? 2) What would the custom property name look like in this script? For example, of of the custom properties is named JobNumber. Would I replace 'foo' with 'JobNumber' and Acrobat knows what to do from there? Or does JobNumber that is metadata have a more complex object name? (Sorry, not at work to test.) – BStone Sep 16 '19 at 02:16
  • Yes, You'd replace "foo" with "JobNumber". The Document "info" object contains all the default plus custom metadata added through the UI. – joelgeraci Sep 16 '19 at 13:47
  • I've given this a shot, substituting foo with the actual name, yet still failed. Is the 'source' to be repeated like you have shown? – BStone Sep 16 '19 at 22:54
  • yes. event.source is the PDF file that represents the stamp. - event.source.source is the PDF file the stamp is being applied to which is where you want to pull the custom metadata (info) from. – joelgeraci Sep 16 '19 at 22:57