Hello,
I would like to synchronize external events (from a WebSocket) and the advancement of my presentation in Acrobat.
I'd like to use the AVPageViewGoTo function when I get an event from this WebSocket.
Therefore, I created a C++ class handling my WebSocket connection. In this class, I have a method binding the WebSocket's events to a function passed as a parameter.
In my plugin, I have a function ("GoToPage") which looks like this:
void GoToPage(int pageNumber)
{
AVPageView page = AVDocGetPageView(AVAppGetActiveDoc());
AVPageViewGoTo(page,pageNumber - 1);
}
I pass it as a parameter (as a std::function<void(int)>) to my WebSocket client.
My problem is that whenever the "AVPageViewGoTo(page,pageNumber - 1);" line is called from the client, my plugin crashes and I have an access read violation (even if page is not null).
I guess that this problem is due to the fact that I try to call a function of Adobe Acrobat's API outside the main thread (as explained here https://forums.adobe.com/thread/1432181). Is this correct?
If that is the case, can I create a handler as explained in the documentation to achieve my initial goal? And if so, may I get a bit more information on the topic?
Thanks in advance for your answers.