Copy link to clipboard
Copied
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
}
}
1 Correct answer
Run the same code multiple times. You can do it in a for-loop.
Copy link to clipboard
Copied
Run the same code multiple times. You can do it in a for-loop.

