• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Launching a PDF in Acrobat from Internet Explorer

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
skatz
Asked:
skatz
1 Solution
 
TNameCommented:

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
 
skatzAuthor Commented:
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
 
TNameCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
skatzAuthor Commented:
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
 
skatzAuthor Commented:
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
 
TNameCommented:
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
 
TNameCommented:
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
 
TNameCommented:
trar´ted=treated  :-/
0
 
cyberpranavCommented:
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
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now