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

Save as command button

jlj747
Registered: Jul 27 2008
Posts: 31
Answered

Is it possible to have a command button that will do a "save as"?
If so, how can I do this? (Need to make a form as simple as possible)

Also, when inserting new fillable form fields I would like the field to show what they need to do in that field, such as entering a number, but when they do the instructions need to be removed when they type in the number.

Example - inside the box it says "Enter Tag Number" - when they start to enter it only the number is in the box. They should not have to delete the message.

Any help would be appreciated.

Acrobat 9.0 Standard

My Product Information:
Acrobat Standard 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
To add a SaveAs button just put a button on the document that executes the "SaveAs" menu item.

Having a field with instructions in is a good one. This is a common techique in other forms technologies.

In PDF it can be accomplished with the format event script. something like this

In Format event for field:

if(event.value == "")
event.value = "Enter Tag Number";

In this example, the code is comparing the entered value against an empty string. The actual value that needs to be compared against, depends on how the field is being manipulated by the other events, it might be "0".

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

jlj747
Registered: Jul 27 2008
Posts: 31
Thanks that is what I needed.

I found a "Save as" in the Buttons Properties-Actions-Select Action

There is a whole list of commands there.
katumba1
Registered: Feb 3 2010
Posts: 3
Is it possible to add a "save as" button to the toolbar in addition to a "save" button? I know I can just hit Shift+Ctrl+S to do that... Just a bit easier with a button. I'm using Acrobat 8 Standard.

Thanks!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, you can create your own SaveAs toolbar button.

Take a look at AcroButtons:
http://www.windjack.com/products/acrobuttons.php

And this article:
http://www.acrobatusers.com/tutorials/2008/10/using_trusted_functions

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

katumba1
Registered: Feb 3 2010
Posts: 3
Thank you for that! Is there possibly an easier solution than $99 or a javascript? or, a tutorial on how to make that script? sorry to be newbee!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Don't appologize for being a newbee.

Unfortunately, unlike other popular applications, Acrobat does not include a feature for easily creating toolbar button macros. The only way it can be done is with a folder level automation script. You can write this be hand, and there is an example in this article:
http://www.acrobatusers.com/tutorials/2007/10/apply_security_with_js

AcroButtons makes this much easier by creating the JavaScript code, including an icon, that creates the button.


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Binu123
Registered: Mar 31 2010
Posts: 1
I need to save a pdf file in text format. Acrobat reader has the option - "Save as Text". Basically I need to excute this operation from command line or using Visual Basic, with out opening the pdf file.

Appreciate any help.

Binu

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The only way to use Acrobat to Save As Text is to open the file. However, this operation can be automated with a VB app without necessarily having Acrobat become visible. There are two parts to this solution. First, from the VB app the Interapplication Communication Interface is used to open the file in Acrobat. Second, the actual SaveAS Text is done through JavaScript. The VB app calls a folder level JavaScript function to accomplish this. You'll need to write the folder level function as a trustedFunction.

You can find the functions, and examples you'll need to impliment this solution in the Acrobat SDK docs here:
http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?&accessible=trueYou'll also find information on folder level scripts and saving a PDF in the tutorials on this site

http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?&accessible=true

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script