abracadabraPDF › Forums › PDF – Général › Personnalisation d’un bouton permettant d’importer une pièce jointe › Répondre à : Personnalisation d’un bouton permettant d’importer une pièce jointe
Merci ! Je respire déjà mieux de savoir qu’il existe une solution :)Par contre je n’ai pas réussi… j’ai du foirer qqch dans ce code:
var nbPJ=0;
this.syncAnnotScan();
var annots=this.getAnnots();
if (annots!=null) {
for (var i=0; i
var j=j+1;
annots.delay=true;
annots.delay=false;
nbPJ++;
}
}
}
if (nbPJ==2) {
app.alert(“You can attach maximum 2 files. Please merge your documents if necessary.”);
var attachbutton = getField(“attach_A”);
var attachedbutton = getField(“attached_A”);
attachbutton.display = display.hidden;
attachedbutton.display = display.visible;
} else {
var annot = this.addAnnot({
page: 2,
type: “FileAttachment”,
author: event.target.name,
contents: “Double-clic to open”,
attachIcon: “PushPin”,
point: [-500,0],
strokeColor: color.blue,
});
annot.author = annot.attachment.name;
if (annot.attachment !== null) {
var filenamesfield = this.getField(“files_field_A”);
if (filenamesfield.value == “”) {
filenamesfield.value = annot.attachment.name;
}
else {
filenamesfield.value = filenamesfield.value + “n” + annot.attachment.name;
}
}
}
Tu pourrais me dire ce que je dois corriger?