"Link" Text Field to Custom Properties

Is there away to "link" a Text Field (that's created in Acrobat) to the Custom Properties in that PDF? Does a script already exist for this?

I'm assuming it'll have to be done through scripts. Which script: JavaScript? Python?


Robin John


2 Answers

Voted Best Answer

What exactly do you mean by "link"? Do you want to display a custom property in a text field? Do you want to set a custom property via a text field?

When you are dealing with scripting in the PDF world, then JavaScript is what you would use. It's built into Adobe Acrobat, the free Adobe Reader and a number of 3rd party PDF viewers.

The following script for example will print all (even custom) info properties:

for (var i in info) { 
    console.println("info[" + i + "] = " + info[i]);
}

So, to get one of these properties into a field, create a text field and use the following as it's custom calculation script:

event.value = info["GTS_PDFXConformance"];

For e.g. a PDF/X compatible file, this might show "PDF/X-3:2002"

See here for more information about the info object: http://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_properties.htm%23TOC_info1bc-21&rhtocid=_6_1_8_23_0_20

Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com


By Karl Heinz Kremer   

Can you provide an example?

________________________________________________________________________________________________________________ www.PDFAutomationStation.com

IMAGE ALT TEXT IMAGE ALT TEXT IMAGE ALT TEXT

_________________________________________________________________________________________________________________


David Dagley   


Please specify a reason: