Copy link to clipboard
Copied
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?
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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!