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

Can scripting alter toolbar email?

RichLorn
Registered: May 19 2008
Posts: 46
Answered

I haven't found a way to do this with any standard settings thru Livecycle 8 or Acrobat Pro 9, so I'm hoping for a solution with javascript.

Ideally I want to, in some way, prevent user data in a pdf from being emailed. Naturally the form is designed without an email submit button. Extended reader right must be enabled to allow the user to complete the fields on screen. My problem is preventing the user from sending the form data by using the email button on the reader TOOLBAR.

I found an old post on Adobe's Developers Knowledgebase board (for Acrobat 5):

------------------------------------------------------------------------------------------
How To: Remove or hide Acrobat toolbars from an external Acrobat window

Summary
An effective way is to open a PDF file on a browser window without Acrobat toolbars is to add #toolbar=0 to the HTML http code.

Issue
How do I display a pdf in the browser while hiding the Acrobat toolbar?
Solution
Generally, there are functions/properties to remove or hide Acrobat toolbars or tool buttons through plug-ins, Windows OLE, Apple Event, and JavaScript. For example, Acrobat document-level JavaScript provides a convenient way to remove tool buttons using the following code:
app.hideToolbarButton("ButtonName");
However, hiding the toolbar through the Open Options in Acrobat will only hide the toolbar if the PDF does not work with the web browser. In order to open a PDF file in a web browser, without the Acrobat or Acrobat Reader toolbar, you would need to link to the PDF with the following HTML code, where #toolbar=0 follows the .pdf filename:

Link without toolbar

For both IE and Netscape (i.e, 4.7), the syntax #toolbar=0 should work. The syntax '#toolbar=false' works in IE 5.5 sp2 on Windows 2000.
------------------------------------------------------------------------------------------
I tried both and they don't work for the current reader versions. (at least not for me)

Can a script be written which will do any of the following ... :

[first choice] disable (or gray out) the toolbar email button?
[second choice] automatically clear all data fields before the pdf is emailed? (some kind of "clear form" function invoked when the toolbar email button is clicked)
[third choice] automatically perform a redaction of form fields when the toolbar email button is clicked?
[fourth choice] replace the completed pdf form with a dummy blank form (or subform) when the toolbar email button is clicked, so only the dummy form is emailed in its place?

As I know next to nothing about javascript, I hope someone can help me out of a tight jam. Thanks.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The toolbars can be removed from a setting in the document properties. Look on the "Initial View" tab. However this does not remove the ability of the user to display and use the buttons if they know how to do it.

Why do you need to extend the form with Reader Rights? The user can fill out any form and print it without these rights. Enabling is only needed to save the form locally, which means the user could just attach it to an email in the ordinary way and there's nothing you can do in Acrobat to stop this. Alternativley, if rights are not applied to the PDF they can still fill it out but can't save or email the data.

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

RichLorn
Registered: May 19 2008
Posts: 46
Hi Thomp
You are right on the money as usual. My error, I don't need extended reader rights.

But I have already tried the initial view settings, as they look like what I need. Unfortunately, the form was created in LiveCycle 8, and when I open it in Acrobate Pro 9, all the initial view settings are grayed out, unavailable.

Mia culpa, I should've been clearer in my post. I'm not really expecting to find a foolproof way of preventing emailing the filled-in form. Probably isn't possible. I'm hoping to find a way to *discourage* the average user from inadvertantly emailing the form. By applying Livecycle security rights, it's true the form data can't be saved in Reader, but it can still be emailed.

Can you give me some guidance on the reason the initial view settings aren't available, and what I can do to about it? I guess the old knowledgebase tip above, won't work in the new Acrobat/Reader versions?

Many thanks
RichLorn
Registered: May 19 2008
Posts: 46
I found this Adobe tip in my research. It has the feel of what I need to do. The problem is, it is so far over my head, all I can see is the jetstream.

http://livedocs.adobe.com/livecycle/8.2/ddxRef/wwhelp/wwhimpl/common/html/wwhelp.htm?context=DDX&file=000673.phpCan this, or something like it, be inserted when viewing the pdf with the Livecycle xml Source view, to accomplish what I need? Somewhere near the heading is my guess?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
And removing the tool bar button does not prevent one from opening the email program, opening an email and attaching the file through the use or the 'attachment' object.

George Kaiser

RichLorn
Registered: May 19 2008
Posts: 46
That's very true gkaiseril. But like I said, it can't be made foolproof. That extra step of the user having to open his email client and attach the pdf is unavoidable, but would provide the discouragment and inconvience on the part of the average user that I'm looking for.
nicole182230
Registered: Oct 13 2009
Posts: 1
I want to hide the toolbar when embedding a pdf file into HTML. I am using the following code:On my desktop where I have Adobe Reader 9 installed the toolbar is hidden correctly in both IE7 and Firefox. But on my laptop where I have Adobe Acrobat 9 Pro Extended, the toolbar is hidden in Firefox, but in IE7 it is still displayed.

Is there something I am missing or doing wrong?

D
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Rick, The DDX reference is for the LiveCycle ES Assembler server. For dynamically creating PDF forms.

Sorry I missed be bit about it being an LC doc. Mia culpa tambien.

So what you can't set with the Initail view properties you can do with JavaScript. In the DocReady event use this script

app.toolbar = false;

This does exactly what the Initail Veiw setting does.

In Adobe Reader, a normal form (Not Rights Enabled) cannot save, email, or submit a filled in form. It can email or submit form data. However, without special knowledge the user can only do this if there is a button on the PDF that is setup for it.

Your best bet is to Add the script I mentioned to the form and secure it for everything except form filling and printing, and do not apply Reader Rights.

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

RichLorn
Registered: May 19 2008
Posts: 46
Works fine Thomp, thank you!! I also added app.toolbar=true; to DocClose, so the user's toolbar will be restored.

Good luck on your e-seminar later this month. (I'll be sitting in the back of the class cheating off of somebody else's paper.)