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

AVAppOpenDialog fails in Windows Acrobat 32-bit but okay in Acrobat 64-bit in latest Acrobat release

New Here ,
Sep 26, 2023 Sep 26, 2023

I included a snippet of sample code [found here:

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/plugin/Plugins_Documents.html ]

into my plug-in code.  When executed, after the open dialog is displayed and user selects a file, Acrobat crashes.  The same code compiled for Acrobat 64-bit runs without issues. 

 

This test was performed after my plug-in (that runs similar code) crashed in a similar manner.  The crash after AVAppOpenDialog started in the most recent release (2023.006.20320).  The code did not crash in any of the previous versions of Acrobat.  

 

I know I can replace the AVAppOpenDialog with a Windows file dialog - but would  like to know why this is happening only in the latest release.

 

Any help or insight would be greatly appreciated.

 

ASPathName OpenPDFFile()
{
 
//Declare an AVOpenSaveDialogParamsRec object
AVOpenSaveDialogParamsRec dialogParams;
 
//Create local variables
AVFileFilterRec filterRec, * filterRecP;
AVFileDescRec descRec;
ASPathName* pathName = NULL;
ASFileSys fileSys = NULL;
ASBool bSelected = false;
char errorBuf[256];
 
//Set up the PDF file filter description
strcpy(descRec.extension, "pdf");
descRec.macFileType = 'PDF ';
descRec.macFileCreator = 'CARO';
 
//Set attributes that belong to the AVFileFilterRec object
memset(&filterRec, 0, sizeof(AVFileFilterRec));
filterRec.fileDescs = &descRec;
filterRec.numFileDescs = 1;
filterRecP = &filterRec;
 
//Set attributes that belong to the AVOpenSaveDialogParamsRec object
memset(&dialogParams, 0, sizeof(AVOpenSaveDialogParamsRec));
dialogParams.size = sizeof(AVOpenSaveDialogParamsRec);
dialogParams.fileFilters = &filterRecP;
dialogParams.numFileFilters = 1;
 
DURING
//Set the AVFileFilterRec object's filterDescription attribute
filterRec.filterDescription = ASTextNew();
ASTextSetEncoded(filterRec.filterDescription, "Adobe PDF Files",
ASScriptToHostEncoding(kASRomanScript));
 
//Set the AVOpenSaveDialogParamsRec object's windowTitle attribute
dialogParams.windowTitle = ASTextNew();
ASTextSetEncoded(dialogParams.windowTitle, "Select A PDF To Open",ASScriptToHostEncoding(kASRomanScript));
 
//Display the Open dialog box - pass the address of the ASFileSys object
bSelected = AVAppOpenDialog(&dialogParams, &fileSys, (ASPathName**)&pathName, NULL, NULL);
 
HANDLER
//Display an error message to the user
ASGetErrorString(ASGetExceptionErrorCode(), errorBuf, 256);
AVAlertNote(errorBuf);
END_HANDLER
 
//Destroy the ASText object then return
ASTextDestroy(filterRec.filterDescription);
ASTextDestroy(dialogParams.windowTitle);
 
return bSelected ? *pathName : NULL;
}

 

TOPICS
Acrobat SDK and JavaScript , Windows
559
Translate
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
New Here ,
Oct 01, 2023 Oct 01, 2023
LATEST

Even we also observed that AVAppOpenDialog is crashes in 32 bit, This code works fine in previous version.

Crashes is happening from most recent release (2023.006.20320).

Fix to this issue in coming new release would be greatly appreciated.

Translate
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