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

emailto: Java?

RightOnScott
Registered: Mar 3 2008
Posts: 3
Answered

Hi all, I'm a new user. Acrobat is awesome!

I'm working with a .pdf file and I'm trying to create a button that users can push to contact me via email. I'm not versed in JavaScript at all, and went to a generator site to try and generate the Java to work, but it gives me an error when I paste it in the Java Window- assigning it to run when the button is pushed.

Anyone have any help? Here's what I came up with....?

support [at] northlandmedia [dot] net ([IMAGE])

My Product Information:
Acrobat Pro 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
First, Acrobat uses JavaScript as it's scripting language, not Java. I know the names are confusing, but this is a very important distinction when you are trying to lookup information on the web. Java is a completely different language.

Second, and this is another point of common confusion, JavaScript is a language that is integrated into other applications. Most notably, web browsers. However, while all the apps that JavaScript is integrated into use the same Core JavaScript language, they differ vastly in how they are connected to thier parent application. So a script that was written for a web browser is not even remotely related to a script written for Acrobat. You have to be very specific when searching for information on Acrobat JavaScript.

Third, what you've shown above is not JavaScript code at all, but an HTML link tag.

Not to get you on the right track. The code for sending an email is a simple one liner. Enter this code into the Button JavaScript.

    app.mailMsg({bUI:true, cTo:"<span class="spamspan"><span class="u">support</span> [at] <span class="d">northlnadmedia [dot] net</span></span>",cSubject:"Support",cMsg:"Put message here");

This code can span several lines, but you can't break a quoted string between lines

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

RightOnScott
Registered: Mar 3 2008
Posts: 3
Thomp...thank you so much! I don't know this stuff very well, I'm learning though... thanks again