I'm trying to embed Abode Reader into my win app, the target itself is simple viewing of PDF documents from th app, no free rendering libraries (GPL won't do) were found, so that's my solution. QAxWidget solved most of the problem, but I also need to know some minor info, like number of the current page.

Trying sort of:

ui->axWidget-> dynamicCall("LoadFile(const QString &)", "C:/sample.pdf"); // works fine

Seems there's a nice reference: Interapplication Communication API Reference - Adobe

All the methods from AxAcroPDFLib.AxAcroPDF object are called fine and work OK. But those are setters, for getters AcroExch.AVPageView is required, though neither Qt Creator, nor manual search, not even ui->axWidget->querySubObject("something") offer me (other?) suitable ActiveX object for it. GetActiveDoc() can be called from AcroExch.App object, wich I also have nowhere to get from.

The question is: how is it possible to obtain the current page number via AciveX if possible at all?

有帮助吗?

解决方案

Damn, I was a bit dumb, found an answer after a while.

All the "getters", like methods obtaining numder of current page, total number of pages, current zoom, etc are supported by the other ActiveX obj, AcroExch.AVPageView (wrapped inside AcroExch.App it is) to be exact.

Detailed info is in the Adobe reference, here: IACReference

But the key point is that Adobe Reader itself provides only AxAcroPDFLib.AxAcroPDF object with "setters" and nothing more, even through DDE messages. Seems that full functionality is only available in Adobe Acrobat, which is not free and is licensed/purchased in a usual commercial way.

Thus, as Adobe has it, you can either use limited Reader OLE methods or purchace Acrobat.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top