"The specifed PDF preset not found" error comes when save pdf action is called & joboption file is added after launching Illustrator
I have a code similar to below code in my plugin.
AIActionParamValueRef mActionParamValueRef;
ASErr result = sAIActionManager->AINewActionParamValue(&mActionParamValueRef);
result = sAIActionManager->AIActionSetInteger(mActionParamValueRef, kAIPDFOptionSetKey, kAIPDFOptionSetCustom);
result = sAIActionManager->AIActionSetString(mActionParamValueRef, kAIPDFOptionSetNameKey, "[sample]");
result = sAIActionManager->PlayActionEvent("adobe_saveDocumentAs", kDialogOff, mActionParamValueRef);
Steps to reproduce the issue:
Launch illustrator.
Create a new PDF preset (sample.joboptions) file in C:\Users\username\AppData\Roaming\Adobe\Adobe PDF\Settings folder
Run the plugin which contains above sample code.
PDF saved successfully But Error dialog comes "The specified PDF preset is not found".
Note: Error is not reproducible if I goto "Edit > Adobe PDF Presets" and then close the dialog before running plugin.