I think I've run into the problem you're encountering, but I'm not 100% sure. Still, it's worth trying my workaround. Basically -- at least in my case -- the problem was that I needed to let Illustrator take a beat before continuing with the save. The trick was tro create a zero duration timer, something like: ai::int32 delay = 0;
AITimerHandle timer = nullptr;
auto error = sAITimer->AddTimer(pluginRef, "name_of_timeer", delay, &timer);
// check errror Then you just handle the timer callback and do your PDF SaveAs action there. A zero length timer is basically an 'OnIdle' event. If you had a slow enough computer, it might be twenty seconds later if that's how long it takes Illustrator to do whatever it needs to do in response to whatever you did before adding the timer, but it won't call the timer until it's done, which is what's important. If you need the canvas to update in realtime, that's a different problem, but I don't think that's what you're talking about here. For that, you'd want to use AIDocumentSuite::RedrawDocument(), who's comment is: Forces the current document to be redrawn. Illustrator automatically redraws
the document when a plug-in returns, so this function is not usually needed. Typically, I only use that if I'm in a dialog doing somethign on the artboard with annotations, and I don't even always need it.
... View more