Copy link to clipboard
Im trying to detect detect when when a user saves and or closes a PDF. Im struggeling to find a way to this with the Acrobat SDK for .NET Framework (Windows Forms). Im mearly intrested in listening to the save state, and catching when the document (not the application because of the tabs) is closed by the user or some unhandled exception, somehing like the Office Interop API.
Does anyone know if this is possible, or event better, done it before and willing to share their experiamce?
Copy link to clipboard
I'm not sure what you mean by the Acrobat SDK for .Net. (Adobe have so many APIs it's hard to keep track). Can you give an example of a few lines using the API, so we can identify which area it belongs to?
Well, its just the Acrobat SDK and I use the basic IAC sanple for C# as a base
This part of the post: ".NET Framework (Windows Forms)" just describes what I use it in.
Its a fairly open ended question, because im not sure thats even the right part of the SDK to use. The goal is to be able to keep track of a document in a third-party application as described in the original post.
Thank you for the fast reply!
Thanks for clarifying. That example uses the COM-based interface AcroPDF.dll - one of the very few found in the free Acrobat Reader as well as Acrobat. The API is limited to what is in the documentation, a pretty basic display tool. You can't even find what page is being displayed. There is no monitor provided by it, unless COM provides some kind of general callback. If you are working with everyone having Acrobat (paid for) a plug-in written in C++ is another possibility, but even in this case there is no callback for external unhandled exceptions, only regular close.
Thank you, that was clarifying!
I then assume that Acrobat Pro do not have a COM that tells third-party the a document have been closed without the need of plugins?
the perfect world we would tell operating system to open a PDF file with its preffered application, and if that is Acrobat Pro we would like to be notified via COM when ever the file is saved or closed.
I can't think of any way for a non-plugin API to get this info. It's a big API and someone may have a trick, but I am not hopeful. The IAC APIs have less than 10% of the function available to plug-ins. An ugly trick is to wait for the file to be closed at a system level (eg by trying to open it with exclusive access). But two big gotchas (1) you might open too early and lock out Acrobat (2) in unknown and changing circumstances Acrobat might close the operating system file, while still showing the file on screen.