Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Button/Javascript to attach MULTIPLE files

New Here ,
Apr 25, 2016 Apr 25, 2016

I am using the following code that attaches only one file to a PDF.  How could I change my code to allow to attach multiple files?

try {

    var annot = this.addAnnot({

        page: 0,

        type: "FileAttachment",

        point: [500, 500],

        noView: true,

        author: "Attachment"

    });

    annot.cAttachmentPath;

    var attachmentObj = annot.attachment;

    if (attachmentObj !== null) {

        app.alert("Add this file: " + attachmentObj.name);

        var l = this.getField("lst1");

        l.insertItemAt(attachmentObj.name, 0);

    }

}

catch(e) {

    if (e.name == "NotAllowedError") {

        // do nothing

    }

}

TOPICS
Acrobat SDK and JavaScript , Windows
3.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 25, 2016 Apr 25, 2016

Run the same code multiple times. You can do it in a for-loop.

Translate
Community Expert ,
Apr 25, 2016 Apr 25, 2016
LATEST

Run the same code multiple times. You can do it in a for-loop.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines