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

PDF Navigation

Georgestef
Registered: Oct 14 2007
Posts: 24

Again, I apologize for my ignorance but I am just trying to learn enough to do what I think should be an easy thing, so in answering this question please assume I am a raw beginner.
 
I am still trying to get my VB program to open a PDF file and navigate to a page which is defined within the VB program. I found the following code in the documentaion for IAC but I don't know how to implement it:
 
Private Sub myGoto(ByVal where As Integer)
Dim app As Object, avdoc As Object, pageview As Object
app = CreateObject("AcroExch.App")
avdoc = app.GetActiveDoc
pageview = avdoc.GetAVPageView
pageview.Goto(where)
End Sub
 
I am using Acrobat 7.0 professional, Visual Basic 5.0 and I downloaded and installed the Acrobat 7.05 SDK. My questions are
 
1) Where do I put this code?
 
2) what is "AcroExch.App"?
 
3) what is the "Where" argument in the Goto statement.
 
Thanks

My Product Information:
Acrobat Pro 7.0.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You've got a lot of questions here. Unfortunately, there isn't a simple explaination. You need to read the documentation in the IAC users guide. There are explicit intructions for adding the Acrobat ActiveX to your project, and there are some examples in the Acrobat SDK.

You should also upgrade to at least VB6, and be looking at the Acrobat 6 SDK for the samples. These two go together well, although other configurations will work.

Once you get over this hump it really is very simple to use. Just take a look at the sample files in the SDK.

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

Georgestef
Registered: Oct 14 2007
Posts: 24
I am using Visual Studio 5.0 which contains the latest version of visual basic. I am also using Acrobat 7.0 and the acrobat 7.05 SDK why would I want to backtrack to Version 6 at this point? Also when you say I can find sample files in the SDK. Can you be more specific? Do you mean the documentation or the software?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are no differences between Acrobat 6 and Acrobat 7, or 8 for that matter where the ActiveX portion of the IAC is concerned. However, there are variations in the samples provided by the different SDKs. The Acrobat 6 SDK has the best samples for learning. Acrobat 7 and 8 SDK samples, at least the new samples, were written for use in VB.NET.

Look in the SDK Folder for "InterAppCommunicationSupport", this is where the samples are located.

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

Georgestef
Registered: Oct 14 2007
Posts: 24
Many thanks, I found the samples and I think they will be very useful. I did run into a little confusion though. I
went through the process of adding a reference to the ActiveX control. The instructions then say to add the Acrobat ActiveX Control to the toolbox, without instruction of how to do this, so that it can be used. I can't seem to locate the control in the sample project. I would have expected it to show up in the toolbox as other controls I have made reference to were located. I have looked on the toolbox and every where else I can think of and can't seem to locate or identify the control. I can see the control on the form in the example, but still could not Identify the control in the toolbox. Can you tell me where and what to look for when I go through this process for a new project? Again let me remind you I am using 7.05 SDK, 7.0.9 Acrobat and the VB portion of Visual Studio 2005

Thanks
Georgestef
Registered: Oct 14 2007
Posts: 24
Never mind, figured it out on my own. For any other beginners listening in. The adobe PDF ActiveX control is entered into your project by selecting Project\Add Reference. Go to the Com tab and look for and highlight
"Adobe Acrobat 7.0 Browser Control Type Library 1.0." Click OK. To add the control to your toolbox, select Tools\Choose Toolbox Items. Select the COM tab and locate and check the control labelled "Adobe PDF Reader." Click OK and the Control should appear in the toolbox under the General Tab. It will be labelled "Adobe PDF Reader" with the Adobe logo icon. From then on I assume it can be treated like any other control.
Georgestef
Registered: Oct 14 2007
Posts: 24
Dear Thom, Thanks for your help in getting me started on IAC. Useing the examples in the SDK I was able to cobble up an application that essentially does what I want. That is to open a PDF doc and navigate to a page number provided by the VB program. My problem now is that I have both Acrobat and Reader on my machine. The program I modified insists on running Acrobat. I want to distribute this program to people who will likely only have reader on their computers. How can I get this program to open Reader instead of Acrobat? As far as I can tell from the documentation I should be able to do this but so far I have been unable to find a solution. Can you help? I will be glad to send along any details of the program which you might need. Thanks.
Georgestef
Registered: Oct 14 2007
Posts: 24
I little less than I expected but thanks anyway.
Georgestef
Registered: Oct 14 2007
Posts: 24
Much better. I think I am now making some real progress. Many thanks.