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

build content menu and post data to SQL

jamx
Registered: May 4 2009
Posts: 2
Answered

Hello, i am new to javascript and need some help. I wish to build a context menu option ("Copy text to server") within Acrobat which would copy & post some selected text on the PDF to a particular field (say Field1) in a SQL server (Server1) table (Table1)? I believe you have to write javascript to perform the copy and post action. Can some please tell how to create that new context menu option and the javascript code that goes behind it. Many thanks! I have both Arcobat 8 and 9 Professional.

My Product Information:
Acrobat Pro 8.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
What you are asking for isn't really possible using Acrobat JavaScript. There are some things you could do along these lines but the right click context menu cannot be modified and besides, there is no way to directly copy selected. A popup menu can be displayed with the app.popUpMenu() function (See the tutorial on this site), but the events for triggering this are limited to actions on a form field. Posting to a server script can be done with the "doc.submitForm()" function. But there is no facility in Acrobat for communicating directly with an SQL server, you'll need to write the server script so that it can take the posted data and interact with the SQL server.

All of these features would be really helpful, but unfortunately they don't exist.

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.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

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