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

Illustrator SDK sample: Windows plug-in error when exporting to EMF

New Here ,
Nov 05, 2008 Nov 05, 2008

Copy link to clipboard

Copied

Hi All,
I'm trying to create a plug-in that exports a whole AI document or just a selected portion of it to an EMF file.

I've used classes from [SnippetRunner] SDK sample, i.e. from \Code Snippets folder, and I've encountered a very strange behavior when calling
SnpDocumentActionHelper::ExportDocument(ActionDialogStatus dialogStatus, AIActionParamValueRef parameters)
with formats such as WMF, EMF etc.

If function sAIActionManager->PlayActionEvent() is called with 'kDialogOff' status an error message "The plugin cannot complete because of an unknown error" appears, although the export is completed and the return code is 'kNoErr'.

If I try exporting with a dialog interface (omit parameters or 'kDialogOn') everything is fine.

I checked it both for CS3 and CS4 SDK, as well as for WinXp and WinVista.
I also tested with the actual sample plug-in (SnippetRunner), same behavior.

Is this an SDK bug? Any ideas?
TOPICS
SDK

Views

1.2K

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
Adobe
Guide ,
Nov 07, 2008 Nov 07, 2008

Copy link to clipboard

Copied

I don't have a lot of experience with this kind of problem, but the first thing I'd check is the parameter block you're passing the action call. I don't know why it would matter if the dialog appeared or not, unless the export settings block wasn't being filled in with everything it needs?

You might try recording an export you perform manually via the action palette, and then saving it to a file. You can open it up manually and compare it (even if it's a binary block) to what you're doing in code. You might spot something that way.

I don't know what else to suggest though. It's unlikely to be an SDK bug, though it could be a bug in the action-aware part of the exporter.

Votes

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
Guide ,
Nov 07, 2008 Nov 07, 2008

Copy link to clipboard

Copied

Actually, a good way to test that last bit would be to record an export and then play it back with the dialog turned off. If that works, it's not a bug with Illustrator, but with how you're firing the event. AI uses their own SDK so if you don't see the bug when they use it, chances are they're not quite doing the same thing as you (but there is probably a way to make it work).

Hope that helps!

Votes

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
New Here ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

LATEST
Thank you very much for the reply.

Your idea to save as an action file (*.aia) saved the day.

By opening the file in a text editor I was able to find out that, indeed, a parameter value was missing.
The specific format needs an additional 4 byte raw data value (set to NULL and worked fine), apart from the format name and extension.

It's a pity that for most of the export formats there is no detailed SDK documentation (or even API definitions, for that matter) and you must "guess" the calling arguments.
A meaningful error code returned would also be helpful...

Anyway, thanks again.

Votes

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