Extract current page from Adobe Acrobat Reader and DejaVu Reader processes?
I want to make a C# program which will save bookmarks for pdf and djvu files. How can I find out the current page number from the A开发者_JAVA百科croRd32/DjVuReader process?
You may be able to do it via a the DDE protocol which is supported by Adobe Acrobat. Check the DDE Spec (Adobe Inter Proces Communication Support Paper) for Acrobat.
Now, if you are not familiar with DDE, let me give you a brief overview - it is a Microsoft (Windows) based IPC protocol similar to named pipes (Windows), COM(OLE), WCF, MSMQ (for IPC), RPC, etc.. Actually MSMQ is probably in my opinion the closest.
Basically with DDE you connect to a DDE server (local machine that's running acrobat), and send messages/commands to it. The trick to it is that DDE is not natively supported by .NET (any version). To get around this issue, you can use the NDDE wrapper (written in Managed C++) on CodePlex
I have sucessfuly been able to force AcroRd32.exe to open file, print specific pages to a network printer... etc using this library (NDDE), which is why I would recommend it. It sure as hell beats paying for a Acrobat Development Toolkit license.... grrrrrr.
In either case, I hope this helps. You might be able to do it via OLE automation & COM but I have never tried it.
Thanks,
<bleepzter/>
PS. Please mark my question if it has helped you in your endeavors :) Thanks!
精彩评论