But the button does not display at all if Acrobat is launched by clicking on a pdf file.
There must be something else I need to do when Acrobat is launched by a pdf file.
The button does display if Acrobat is launched by clicking on a pdf file.
It does sometimes load the button when launching a pdf file. It seems inconsistent. I would say approx 50% of the time it does not. I just tried it twice with the same file and once the button loaded. Second time it did not. This is the same experience for myself here and others users here. It is a problem.
Is there anything I can check when Acrobat launches without the button to find out why when the button does not load?
Thanks for any advice.
Thankyou for the responses.
1. This is a large corporate controlled infrastructure with ~40,000 global desktops centrally IT managed. In its favour it is a stable environment. I have influence but I cannot control upgrade of anything. (We are still on Office 2003 !).
2. I launched (the same document), the button did not appear. I gave it some time, did CNTL J to launch the console. (I have noticed it takes ~ a few secs to display the menu button on launching Acrobat). No errors displayed in the console. No menu button.
Console displays the usual:
Acrobat Database Connectivity Built-in Functions Version 8.0
Acrobat EScript Built-in Functions Version 8.0
Acrobat Annotations / Collaboration Built-in Functions Version 8.0
Acrobat Annotations / Collaboration Built-in Wizard Functions Version 8.0
Acrobat Multimedia Version 8.0
Acrobat SOAP 8.0
Again - your help much appreciated.
1 person found this helpful
What can you see in the Scripts window of the Debugger?
1 person found this helpful
No, because the scripts are always loaded on every new Acrobat process. In fact, there is no way to NOT load them.
Make sure you have closed ALL your Acrobat windows (including anything open in the browser). Bring up the Task Manager and kill the Acrobat.exe process just to be sure - Acrobat will only parse the contents of that folder on a new process launch, it will not do so when a new instance of an existing process is spawned.
Checked task manager - no acrobat.exe running.
Launched pdf file. No button appears in Acrobat.
Scripts window of debugger is blank.
Console has no errors.
Repeated 10 times - same result every time.
Launch Acrobat and the button appears.
Close Acrobat. Launched pdf file. No button appears in Acrobat.
Exception in line 1 of function top_level, script Console:Exec
GeneralError: Operation failed.
The toolbutton specified could not be found
i.e. the button appears not to have been loaded.
app.addToolButton(oButObjAddSigningPage); <- two buttons appear.
app.removeToolButton(oButObjAddSigningPage); <- one button disapears.
I am beginning to see a clue.
The pdf file I have trying this on now seems to never allow the button to load.
Trying with different pdf files the button does always load.
I think the clue is that the add and remove toolbar feature is context sensitive.
e.g. doing this with a document loaded always fails:
It is a shame it says it cannot find the button when it should say the context is wrong.
This is because the button was loaded with Acrobat before the document was loaded. Removing the button can only be done when no document is present. Similarly if the button was created while a document is loaded then the button disappears when the document is closed, and reappears when the document is opened.
Doesn't quite explain my problem but seems a clue. I will throw away my test document and move on to others.
Thanks for the suggestions.
The proper input to the "app.removeToolButton" function is the name of the toolbar button, not the object that was used to create it. Try this:
The very first thing you need to check for is the "Add-ons" toolbar. After loading your document, and when the toolbar button doesn't show. Right click on an empty portion of the Acrobat Toolbar to display a list of all the individual toobars. Is there an Add-ons Toolbar Listed? Is it checked?
To determine if your Folder level script was loaded and run, Test the function created in that script.
Run this from the console window
The code for the function will be returned if is was defined.
To determine if your toolbar button was loaded, run this code from the console window.
var lst = app.listToolbarButtons()
if(lst[i].cName == "JSAppToolBar")
the "JSAppToolBar" is the internal name of the "Add-ons" toolbar.
However, from what you have described it does look as if you've hit on a bug. Probably a timing issue. What are the characteristics of this file?
The source for PDF Scripting Info
Thanks Thom. That check for the JSAppToolBar is useful.
The problematic pdf file has been deleted so I cannot examine it futher.
Thanks for everyone's help.