?
Solved

Launching a PDF in Acrobat from Internet Explorer

Posted on 2007-04-09
11
Medium Priority
?
359 Views
Last Modified: 2013-11-25
I tried the solution offered in this discussion but it didn’t work:

PDFs: How to launch Adobe Reader INSTEAD of displaying in browser

<html>

<head><script LANGUAGE="vbscript">
<!--
Dim WshSHell
set WshShell = CreateObject("WScript.Shell")
Sub calctxt_onclick
WshShell.Run("AcroRd32.exe w3.pdf")
End Sub
-->
</script>

<title></title>
</head>

<body>
<a href="#" NAME="calctxt">
<p>Run Acrobat file</a></p>
</body>
</html>
******************************************************
We have Acrobat 8 at my company so I substituted “Acrobat.exe” for “AcroRd32.exe” in the script, but didn’t know how to tell it which file to run. I substituted “http://....[filename.pdf]” for the “#”, but that only got me the file opened in the IE browser, which is what I had before. Can someone please help?
0
Comment
Question by:skatz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 28

Accepted Solution

by:
TName earned 2000 total points
ID: 18881230

This works for me (path to the file!)


<html>
<head><script LANGUAGE="vbscript">
<!--
Dim WshSHell
set WshShell = CreateObject("WScript.Shell")

Sub calctxt_onclick
  WshShell.Run("AcroRd32.exe c:\test.pdf")
End Sub
-->
</script>

<title></title>
</head>

<body>
<a href="#" NAME="calctxt">
<p>Run Acrobat file</a></p>
</body>
</html>
0
 

Author Comment

by:skatz
ID: 18882131
I'm sorry, I probably wasn't clear enough in my question. I need the PDF to open in *Acrobat*, not the IE browser. The solution here just lauches the plug-in and opens the file in the browser. I've tried using the Shell method with VBScript and creating an ActiveX object with Javascript, and am not able to launch any *.exe file from a webpage.

The reason I need to do this is that our users need to be able to modify the document permissions we set on the PDFs from the Acrobat app. We restrict them from printing or editing the documents, but if they have the proper authority, they can change the permissions. They need to work with the document in the Acrobat GUI because the IE browser doesn't let them change permissions.
0
 
LVL 28

Expert Comment

by:TName
ID: 18882179
No, you were very clear, I understood you perfectly -  and yes, when I click on the link, Acrobat (the application, not a plug-in) will start and open the .pdf document, outside of IE...

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:skatz
ID: 18882243
You know what, it works! Thank you. I have one more question---can you tell me how to modify the code so that I can pass the file name as a variable when I call the script? (I'll be using this for many different files)
0
 

Author Comment

by:skatz
ID: 18882334
Actually I have an additional question, which might potentially be a big problem. Now that I have that code added to the site, any time I open it, I get a warning message that says "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?". If I click Yes, the page opens and everything is fine. This will be very confusing for our users, however. Is there a way to make the code work without generating the warning message?
0
 
LVL 28

Expert Comment

by:TName
ID: 18882803
Add this comment text at the start of the file:

<!-- saved from url=(0014)about:internet -->

This is the so-called "Mark of the web" solution (makes IE treat the locally stored page like a web page)
See here:
http://www.phdcc.com/xpsp2.htm#markoftheweb


http://www.phdcc.com/xpsp2.htm
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/motw.asp
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q216434&ID=KB;EN-US;Q216434&sd=msdn&
0
 
LVL 28

Expert Comment

by:TName
ID: 18882848
Ok, I see that this won't work - there'll be no error message, but the link won't launch the application either (the file is trar´ted like a page on the web, after all).
Have a look at the other solutions suggested on the pages linked above...
0
 
LVL 28

Expert Comment

by:TName
ID: 18882851
trar´ted=treated  :-/
0
 
LVL 2

Expert Comment

by:cyberpranav
ID: 18896310
To get around the warning message problem, you will have to change the security settings under Security->My Computer->Initialize and script ActiveX Controls not marked as safe->Enable.

This is really a security risk. But will work in your case.

::Pranav::
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20649452
Forced accept.

Computer101
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question