Copy link to clipboard
Copied
Bonjour,
Je souhaite via un bouton exécuter un code javascript, permettant de sauvegarder automatiquement mon fichier pdf dans un répertoire spécifique (cette partie est OK) et que le nom du PDF correspond à champ rempli au préalable.
Exemple :
Numéro utilisateur = 2223
Emplacement par défaut : D:\test\
Nom du fichier pdf : 2223.pdf
Merci de votre aide
Copy link to clipboard
Copied
In English :
Hello,
I would like to execute a javascript code via a button, allowing me to automatically save my pdf file in a specific directory (this part is OK) and that the name of the PDF corresponds to the field filled in beforehand.
Example :
User number = 2223
Default location : D:\test\
Name of the pdf file : 2223.pdf
Thank you for your help
Copy link to clipboard
Copied
So you created a trusted function to save the file, and you just want to know how to use the values of the field as the new file name? Can you post the code you used so far?
Copy link to clipboard
Copied
Hello,
For the moment, I was only using this.saveAs("/d/") but I want to integrate the value of a field created in the form as the name of my pdf file.
Copy link to clipboard
Copied
That's not going to work. In order to be able to do it you have to use a trusted function located in a folder-level script (a .js file in a specific folder on the computer).
Read these tutorials:
https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript
https://acrobatusers.com/tutorials/trust-and-privilege-in-acrobat-scripts
https://acrobatusers.com/tutorials/using_trusted_functions
Once you have that function specifying the file path is easy.
Copy link to clipboard
Copied
try67 a raison, avant d'aller plus loin il vous faut savoir que ça ne peut fonctionner que depuis un script d'application, depuis une Action ou depuis la console JS. Ce qui veut dire que ça ne fonctionnera que sur des postes pré-équipés et pas sur celui de l'utilisateur lambda.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more