These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Extract a PDF file attachment?

Jerome69
Registered: Nov 18 2011
Posts: 8

Hi everyone
can someone help me to write a Javascript that could extract a PDF file attachment? I search on this forum and some others but I didn't find any solution… i think this could be done using a link or a button, but i didn't find how to write this JS.
 
Thanks for your help
regards
Jerome

My Product Information:
Acrobat Pro 10.1, Macintosh
Jerome69
Registered: Nov 18 2011
Posts: 8
Finally i just found the answer, I need to put this JS to a button:
this.exportDataObject({ cName: "MyPDF.pdf", nLaunch: 2 });

For information, the number 2 corresponding to:
nLaunch (optional, Acrobat 6.0) nLaunch controls whether the file is launched, or opened,
after it is saved. Launching may involve opening an external application if the file is
not a PDF file. The values of nLaunch are:
● If the value is 0, the file will not be launched after it is saved.
● If the value is 1, the file will be saved and then launched. Launching will prompt
the user with a security alert warning if the file is not a PDF file. The user will be
prompted for a save path.
● If the value is 2, the file will be saved and then launched. Launching will prompt
the user with a security alert warning if the file is not a PDF file. A temporary path
is used, and the user will not be prompted for a save path. The temporary file
that is created will be deleted by Acrobat upon application shutdown.
The default value is 0.

If it can help someone…

Jerome
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Jerome69 wrote:
● If the value is 0, the file will not be launched after it is saved.
Try it before, it's buggy…

:-(