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

Adobe DC - javascript save

New Here ,
Apr 17, 2021 Apr 17, 2021

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

TOPICS
Edit and convert PDFs , How to
1.1K
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
New Here ,
Apr 17, 2021 Apr 17, 2021

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

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
Community Expert ,
Apr 17, 2021 Apr 17, 2021

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?

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
New Here ,
Apr 17, 2021 Apr 17, 2021

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.

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
Community Expert ,
Apr 17, 2021 Apr 17, 2021

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.

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
Community Expert ,
Apr 17, 2021 Apr 17, 2021
LATEST

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.

Voir : https://www.abracadabrapdf.net/ressources-et-tutos/js-et-formulaires-ressources/les-differents-nivea...

 

 


Acrobate du PDF, InDesigner et Photoshopographe
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