abracadabraPDF › Forums › PDF – Général › Relier des formulaires › Répondre à : Relier des formulaires
25 février 2018 à 14:25
#63471
bebarth
Maître des clés
bonjour,
Premièrement, Il faut que tes fichiers 1 & 2 possèdent un script de document :
Code:
this.disclosed = true;
https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_properties.htm%23TOC_disclosedbc-12&rhtocid=_6_1_8_23_0_11
Ensuite, pour des raisons de sécurité, le script ci-dessous ne sera réalisable qu’à partir d’une action :
Code:
var Chemin = this.path;
var Dossier = Chemin.substring(0,Chemin.length-this.documentFileName.length);
var otherDoc = app.openDoc({
cPath: Dossier+”Fichier_1.pdf”,
});
var champA= otherDoc.getField(“A”).value;
otherDoc.closeDoc();
var otherDoc = app.openDoc({
cPath: Dossier+”Fichier_2.pdf”,
});
var champB= otherDoc.getField(“B”).value;
otherDoc.closeDoc();
this.getField(“C”).value= champA+champB;
var Dossier = Chemin.substring(0,Chemin.length-this.documentFileName.length);
var otherDoc = app.openDoc({
cPath: Dossier+”Fichier_1.pdf”,
});
var champA= otherDoc.getField(“A”).value;
otherDoc.closeDoc();
var otherDoc = app.openDoc({
cPath: Dossier+”Fichier_2.pdf”,
});
var champB= otherDoc.getField(“B”).value;
otherDoc.closeDoc();
this.getField(“C”).value= champA+champB;
…script à adapter, of course !!!
Dans ce script, tous les fichiers sont dans le même répertoire.
@+
:bonjour: