Javascript function to view attachments
I’ve created a button on a customized form in Adobe Acrobat Pro DC to display a list of its attachments. When I click on the button nothing occurs. I get no error msgs, just nothing at all. My Adobe Form does have half a dozen attachments which are visible if I click on the paperclip in the left ribbon. I’d like that same functionality via a customized button, which I have created. I’d appreciate any assistance
The properties of the button I've created are these:
In the button Options I’ve selected the Behavior to Push,
and the State is Up
In the Action option I’ve selected Run a JavaScript. The script is
if (app.viewerVersion < 11)
{ listing_pre_11();
} else {
listing_11(); }
In Document JavaScripts I’ve a script name of listing_file
The script is
function listing_file()
{
// List ANY ATTACHMENTS
var d = event.target.dataObjects;
if (d != null)
for (var i = 0; i < d.length; i++)
{
console.println("Data Object[" + i + "]=" + d.name);
}
}
