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

Adobe Acrobat Fill&Sign single click fire a lot of callbacks that lead to crush of application

Community Beginner ,
Jan 22, 2021 Jan 22, 2021

Copy link to clipboard

Copied

Hello, at least two monthes I observe that when user click on Fill&Sign and place a sign acrobat produce a lot of events and sometimes it leads to crush application. 
First I thought that some issue in my code but I did find nothing.
So I created basic plugin from suggested template, subscribed to a PDDocDidClose, PDDocWillClose, PDDocWillSave, PDDocDidSave events and run test.
In case when I try to retrieve file name from PDDoc it will crush (not always)(only one action in each callback). 

Register callbacks:

 

ACCB1 ASBool ACCB2 PluginImportReplaceAndRegister(void)
{
    // Create and register the PdDoc closed notifications callback
    m_PDDocDidCloseCallback = ASCallbackCreateNotification(PDDocDidClose, MyPDDocDidClose);
    AVAppRegisterNotification(PDDocDidCloseNSEL, gExtensionID, m_PDDocDidCloseCallback, nullptr);

    // Create and register the PDDoc will save notification callback
    m_PDDocWillSaveCallback = ASCallbackCreateNotification(PDDocWillSave, MyPDDocWillSave);
    AVAppRegisterNotification(PDDocWillSaveNSEL, gExtensionID, m_PDDocWillSaveCallback, nullptr);

    // Create and register the PDDoc did save notification callback
    m_PDDocDidSaveCallback = ASCallbackCreateNotification(PDDocDidSave, MyPDDocDidSave);
    AVAppRegisterNotification(PDDocDidSaveNSEL, gExtensionID, m_PDDocDidSaveCallback, nullptr);

    // Create and register the PdDoc closed notifications callback
    m_PDDocWillCloseCallback = ASCallbackCreateNotification(PDDocWillClose, MyPDDocWillClose);
    AVAppRegisterNotification(PDDocWillCloseNSEL, gExtensionID, m_PDDocWillCloseCallback, nullptr);

	return true;
}

 

Plugin Init: 

 

ACCB1 ASBool ACCB2 PluginInit(void)
{
    gDigSigHFT = ASExtensionMgrGetHFT(ASAtomFromString("DigSigHFT"), 1);
    DigSigRegisterObserver(DSDidSign, OnDidSignSucess, OnDidSignFail, nullptr);

	return MyPluginSetmenu();
}

 

Plugin Unload: 

 

ACCB1 ASBool ACCB2 PluginUnload(void)
{
	if (menuItem)
		AVMenuItemRemove(menuItem);
    std::string s;
    for (std::vector<std::string>::const_iterator i = vv.begin(); i != vv.end(); ++i)
        s += *i + "\n";
    
    //unsubscribe from events
    AVAppUnregisterNotification(PDDocDidCloseNSEL, gExtensionID, m_PDDocDidCloseCallback, nullptr);
    AVAppUnregisterNotification(PDDocWillSaveNSEL, gExtensionID, m_PDDocWillSaveCallback, nullptr);
    AVAppUnregisterNotification(PDDocWillCloseNSEL, gExtensionID, m_PDDocWillCloseCallback, nullptr);
    AVAppUnregisterNotification(PDDocDidSaveNSEL, gExtensionID, m_PDDocDidSaveCallback, nullptr);

    ASCallbackDestroy(m_PDDocDidCloseCallback);
    ASCallbackDestroy(m_PDDocWillSaveCallback);
    ASCallbackDestroy(m_PDDocWillCloseCallback);
    ASCallbackDestroy(m_PDDocDidSaveCallback);

	return true;
}

 

Callbacks:

 

/// <summary>
/// Callback function which calls after closing document.
/// </summary>
/// <param name="pdDoc">Adobe document.</param>
/// <param name="clientData">Converts to CAdobeNdEventsConsumer.</param>
void ACCB2 MyPDDocDidClose(PDDoc pdDoc, void* clientData){
    vv.push_back(" MyPDDocDidClose");
}

/// <summary>
/// Callback function which calls after closing document.
/// </summary>
/// <param name="pdDoc">Adobe document.</param>
/// <param name="clientData">Converts to CAdobeNdEventsConsumer.</param>
ACCB1 void ACCB2 MyPDDocWillClose(PDDoc pdDoc, void* clientData){
    vv.push_back(" MyPDDocWillClose");
}

/// <summary>
/// Callback function whick calls before save event.
/// </summary>
/// <param name="doc">Adobe document.</param>
/// <param name="clientData">Client data.</param>
ACCB1 void ACCB2 MyPDDocWillSave(PDDoc doc, void* clientData){
    vv.push_back("MyPDDocWillSave");
}

/// <summary>
/// Processes PDDoc did save event. Checks if the file that we've saved went out of ND control. If yes -we need to run checkin for this file. Shows the message to the User if checkin failed.
/// </summary>
/// <param name="doc">Adobe Document.</param>
/// <param name="error">Error code.</param>
/// <param name="clientData">Converts to CAdobeNdEventsConsumer.</param>
ACCB1 void ACCB2 MyPDDocDidSave(PDDoc doc, ASInt32 error, void* clientData){
    vv.push_back("MyPDDocDidSave");
}

/// <summary>
/// Saves document if sign success.
/// </summary>
/// <param name="info">Info</param>
/// <param name="clientData">Casts to CAdobeNdEventsConsumer.</param>
void OnDidSignSucess(void *info, void *clientData){
    vv.push_back("OnDidSignSucess");
}

/// <summary>
/// Writes error to log
/// </summary>
/// <param name="error">Error code.</param>
/// <param name="info">Info</param>
/// <param name="clientData">Passed just to save signature</param>
void OnDidSignFail(ASInt32 error, void *info, void *clientData){
    vv.push_back("OnDidSignFail");
}

 

So this is list of callbacks that fired from one click on a Fill&Sign button and signing document(looks like it is not normal behaviour):

 

MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillSave
MyPDDocDidSave
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose
MyPDDocWillClose
MyPDDocDidClose

 

 

TOPICS
Acrobat SDK and JavaScript , Windows

Views

105

Likes

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 ,
Jan 22, 2021 Jan 22, 2021

Copy link to clipboard

Copied

adobe.png

Likes

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 ,
Jan 22, 2021 Jan 22, 2021

Copy link to clipboard

Copied

Event Viewer: 
Faulting application name: Acrobat.exe, version: 20.13.20074.18474, time stamp: 0x5fce7117
Faulting module name: ucrtbase.dll, version: 10.0.19041.546, time stamp: 0x73123758
Exception code: 0xc0000409
Fault offset: 0x0009edbb
Faulting process id: 0x5a90
Faulting application start time: 0x01d6f0a26fd9df84
Faulting application path: C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: 3e460871-3b97-455a-9242-126c02ddbbe8
Faulting package full name:
Faulting package-relative application ID:

Faulting application name: AcroCEF.exe, version: 20.13.20074.18474, time stamp: 0x5fce6055
Faulting module name: libcef.dll, version: 3.5300.0.0, time stamp: 0x5f489851
Exception code: 0xc0000005
Fault offset: 0x0083e186
Faulting process id: 0x38c8
Faulting application start time: 0x01d6f0a270d5078e
Faulting application path: C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\AcroCEF\AcroCEF.exe
Faulting module path: C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\AcroCEF\libcef.dll
Report Id: 9ef2fc45-9f56-48c6-947a-8945fe34d7e8
Faulting package full name:
Faulting package-relative application ID:

Likes

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 ,
Jan 22, 2021 Jan 22, 2021

Copy link to clipboard

Copied

LATEST

This seems a lot of callbacks, but does it crash if your plug-in is missing?

 

"In case when I try to retrieve file name from PDDoc it will crush "

You seem to show code without a crash. Please show code leading to this crash, and identify the exact line of code shown for the crash.

Likes

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