• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Subscribe to save state and detect when a document as been closed from third-party application

Community Beginner ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

Hi!

 

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?

TOPICS
Windows

Views

475

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 21, 2022 Dec 21, 2022

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

...

Votes

Translate

Translate
LEGEND ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

Well, its just the Acrobat SDK and I use the basic IAC sanple for C# as a base

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/samples/Samples_WindowsIAC.html#basiciaccs....

 

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

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.

 

Best Regards

Sondre Ljovshin 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines