Question

I have a MFC-application that uses the Acrobat OCX to display a PDF inside a CView.

When the PDF contains a link, the control changes the mouse cursor when hovering over it, but when I click it nothing happens.

When I use the Acrobat Reader application, it asks me if I want to open the link. So I guess there is some kind of notification message emitting from the control. It would be ok if I just get the address of the link, then I could open it myself.

Was it helpful?

Solution

Active X's link only works to the named destinations inside the same PDF file.

Developing Applications Using Interapplication Communication

You can also treat a PDF document as an ActiveX® document and implement convenient PDF browser controls through the AcroPDF object. This object provides you with the ability to load a file, move to various pages within a file, and specify various display and print options. A detailed description of its usage is provided in “Summary of OLE objects and methods” on page 30.

You probably have to use another OLE autoimation method, such as rendering PDF documents.

Developing Applications Using Interapplication Communication - on OLE capabilities in Acrobat section

You can render PDF documents on the screen in two ways:

●Use an interface similar to the Acrobat user interface.

In this approach, use the AVDoc object’s OpenInWindowEx method to open a PDF file in your application’s window. The window has vertical and horizontal scroll bars, and has buttons on the window’s perimeter for setting the zoom factor. Users interacting with this type of window find its operation similar to that of working in Acrobat. For example, links are active and the window can display any text annotation on a page. The ActiveView sample in the Guide to SDK Samples shows how you can use this approach.

However, before you start this method, I recommend to download Acrobat SDK and excute some sample program whether link event is occured normally. Acrobat SDK have many useful vc++, c# sample program.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top