Skip to main content
Participant
May 24, 2017
Question

Javascript to print attached file names in a text field in Adobe form layout

  • May 24, 2017
  • 2 replies
  • 1746 views

Hi All,

Working on a custom Adobe form layout in SAP where in the requirement is to display the names of the files attached in a text area in the Adobe form layout. File names in the text area should be hyperlinks which opens the file when clicked.

Can anyone help with the JavaScript to get the attached file names and display it in a text area in Adobe form layout ? Also, to make the file names as hyperlink.

Thanks,

Shailendra

    This topic has been closed for replies.

    2 replies

    try67
    Community Expert
    Community Expert
    July 3, 2017

    For questions about scripts in PDF files you should use this forum: JavaScript

    Assuming you're talking about a PDF file, it's possible to display the names of all file attachments in a text file, but not to create links to them.

    To create this list you can use this code as the text field's custom calculation script:

    var fileNames = []

    for (var i=0; i<this.dataObjects.length; i++) {

        fileNames.push(this.dataObjects.name);

    }

    event.value = fileNames.join(", ");

    Participant
    May 25, 2017

    Hi Experts,

    Can anyone please assist with some valuable inputs ?

    Thanks,

    Shailendra

    Jon Fritz
    Community Expert
    Community Expert
    May 25, 2017

    By "Adobe form" do you mean a PDF form?

    It might be better to ask in the Acrobat  forums if that's the case, the Coding Corner is pretty much a ghost town.