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

show sign document dialog on document open

ISee
Registered: May 24 2010
Posts: 6
Answered

Hi colleagues

I would be very thankful if you could help me with a little issue.

My problem is that I should show the "sign document" dialog box after a pdf document opening.

We have a Document Signature Field in our pdf, so I "just" need to simulate this field onclick event or somehow call a Sign Document menu method.

As I get I can't use app.execMenuItem couse this item is not on the white list on client machines.
Also I didn't find any methods to simulate a Signature Field onclick event (execEvent or smth like that)

Is there a possibility to do what I want using javascript or are there some other ways to do it exist?

Thank you for your help.

Regards, Ilya

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The Signature has a "signatureSign()" function. You can call it like this:
this.getField("Signature1").signatureSign({bUI:true});
However, this is a privileged function. It cannot be called directly from inside a document script. You'll have to create a folder level trusted fucntion to call it. Which is exactly what you would need to do to call the menu item.

Signing is an activity that has to be Initiated or Approved by the user. So the user has to either click on the signature field themselves or they have to install a script that will do it.

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

ISee
Registered: May 24 2010
Posts: 6
Thanks for the solution Thom. Also it helps me to understand a general idea a little bit more )

I belive it's an acceptable way to ask customers to install a script.

Could you advise me a method to call this script (trusted function) using pdf ActiveX?

Now I add the call of a signing in all pdf docs on open event in Acrobat Pro and just generate links to these pdfs in my web application.
But if users install the script on their systems it would be better to open a pdf using ActiveX and than call a sign document trusted function.

How do you think is it possible?

Regards, Ilya
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, The Acrobat IAC API has access to the JavaScript environment thorugh the JSO. There is a function for acquiring it. From the JSO a VB script can call a folder level function. You'll find exampes in the SDK and information in the IAC portion of the online SDK reference.

http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?&accessible=trueThom 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

ISee
Registered: May 24 2010
Posts: 6
Thanks a lot Thom. I'll make some investigations using new information.

Looks like it is a really interesting technology )

Thanks once more