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

Custom dialog with populated fields

StevenD
Registered: Oct 6 2006
Posts: 368

Is it possible to create a custom dialog that has some fields populated with the name of the PDF document that is currently open?
 
Example:
I open a PDF with the file name of 12345_eng.pdf. I run a batch sequence/Action that opens a custom dialog in which one of the fields called File Name is populated with the name of the current open file.
 
Fine Name: 12345_eng
 
Possible to do?

StevenD

My Product Information:
Acrobat Pro Extended 9.4.3, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Yes, that's what the "load" method of the dialog is for. You call it in the "initialize" method that you create. The documentation (http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.355.php) should help, but if you get stuck, post again.
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi StevenD,

There is an example of this in the Actions Exchange here (located under the Gallery menu) called "File Name Stamper."

The key to making this work is adding the document object as a member of the dialog object before it is displayed- then you can access it from inside the dialog while it is running.

Hope this helps,

Dimitri
www.pdfscripting.com
www.windjack.com
StevenD
Registered: Oct 6 2006
Posts: 368
Thanks for the responses everyone.

George, I'm using a plug in to create my custom dialogs which is easy enough to do on a basic level. Since I've not used a few of the more complicated features of custom dialogs I will probably post again. Thanks for the documentation link.

Dimitri, Pardon my ignorance but I'm not sure what I am supposed to do with the PDF I downloaded. When I clicked the download button I got a PDF that I can't open. What am I missing?

StevenD

Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi StevenD,

I just downloaded it and it opened fine (Acrobat 8 Pro) so not sure why you can't open it. Instructions for how to install the Action and use it are in the PDF file, and the .sequ file (Action file) is an attachment to it. I did not see before that under product info you have Acrobat 9.4.3- Actions only work in Acrobat X so that Action may be a no-go for you anyway, unless you also have Acrobat X on another machine. Regardless, you should be able to open the PDF download on an older version.

Hope this helps,

Dimitri
StevenD
Registered: Oct 6 2006
Posts: 368
I don't know what was going on with the two previous downloads but every time I tried to open them I got a wrong file type error. I finally got a good PDF downloaded using Firefox on Mac :-( to open.

Since the attached file in the PDF is a .sequ it works as a batch in my Acrobat 9. I have been bringing a lot of my batch sequences over from Acrobat 9 and importing them into Acrobat X as well as exporting them from Acrobat X and using them in Acrobat 9 with no problems. This one works fine in Acrobat 9. Now I just need to go in and try and understand what is going on in the script.

Thanks for the help so far.

StevenD

StevenD
Registered: Oct 6 2006
Posts: 368
I'm just not seeing how to do this. I have tried looking at the Stamper sample and I'm not seeing what I need to do to get the file name of the document to display in the particular field. I have looked at the code in the Action and am just not seeing it.

Also. Is it possible to set the dialog up so whatever values I enter in some other fields in the dialog persist until something else is added?

StevenD