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

Opening PDF in code using URL

samuelkang
Registered: May 30 2007
Posts: 2

How do i open a pdf on my intranet using URL & vb.net? I tried the simple code below.
 
avDoc = CreateObject("AcroExch.AVDoc")
pathString = "http://www.kvmart.loca/Download/Files/test.pdf"
bOK = avDoc.Open(pathString, "Populating Separation Data")
 
Unfortunately, the code works only if I hard code non-URL path such as "c:\inetpub\wwwroot\kvintranet\Download\test.pdf" What gives? The same code with URL worked fine with Acrobat 6 Professional.

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
If this is an ASP.NET, or other server side code then:

1) You are in violation of the Acrobat EULA.

2) It should not work at all since the VB code runs on the server, not on the user's local system. So it would be opening Acrobat on the server, the user would never see it. It probably worked for you in 6 because you're running the server on the same machine your working on. Adobe tightened things up in Acrobat 7. Acrobat might know you're trying to open it from a server script and is refusing to do it.

If the VB is a stand alone exe, then there may be some other problem since it should work. For example, the URL looks like it may have a spelling problem, should "www.kvmart.loca", really be "www.kvmart.local"?

There is another way to get Acrobat to load an URL. Use the JSO object to call "app.launchURL()". Then use "AcroExch.App.GetActiveDoc()" function to get the newly loaded doc.

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