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

SDK 2023 problem: getting current document

New Here ,
Nov 02, 2022 Nov 02, 2022

Hey!

 

I have just migrated from sdk 2022 v4 to sdk 2023 v1 while developing a plugin for Illustrator. I have encountered an issue that some functions that worked well in sdk 2022 do not work in 2023. Mostly they are related to getting the current document and information about it (count the number of layers, getting current document handle, activating a document by index, exporting the document to pdf). Documentation did not seem to change, the solution compiles correctly, other functions related to layers and documents seem to work (like getting a document or layer by index - not activating them though).

e.g. :

sAIDocumentList->Activate(documentHandle, true);  // error DOC?
sAILayer->CountLayers(&count);  // count returns 0 whichever the document is
sAIDocument->WriteDocumentWithOptions(f, kAIPDFFileFormat, kFileFormatWrite, d, false, params);  // error DOC?

sAILayer->GetNthLayer(i, &layerHandle);  // works correctly
sAIDocumentList->GetNthDocument(&documentHandle, ind);  // works correctly

Has anyone else encountered a similar issue? How can it be solved?

TOPICS
Bug , Scripting , SDK , Third party plugins
619
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

correct answers 1 Correct answer

Community Expert , Nov 02, 2022 Nov 02, 2022

Hi @Stanislava257515460ocg,

I have not tested the api's(unfortunately my dev env is not setup so far). However, I have some suggestions, these API's seem to something that would be in use widely. So the first thing I would do is pick a sample plugin shipped with SDK that call's these API's and then check the behaviour. I suspect there is something unique to your situation else we had a good chance of widespread reports for these failures.

Let us know it goes.

-Manan

Translate
Adobe
Community Expert ,
Nov 02, 2022 Nov 02, 2022

Hi @Stanislava257515460ocg,

I have not tested the api's(unfortunately my dev env is not setup so far). However, I have some suggestions, these API's seem to something that would be in use widely. So the first thing I would do is pick a sample plugin shipped with SDK that call's these API's and then check the behaviour. I suspect there is something unique to your situation else we had a good chance of widespread reports for these failures.

Let us know it goes.

-Manan

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 ,
Nov 02, 2022 Nov 02, 2022
LATEST

Hey!

Thanks for the reply!

Actually just understood that it was my mistake, did not set the reference correctly. and with the previous sdk it was probably using the old builds, that's why it was working 😕 But everything works great now, thanks!

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