I'm writing a C# program that is supposed to serve as an intermediate step inside a PDFCreator workflow, while a document is being printed.
It's a regular console program and it works fine when everything else is fine. The root problem, as I've discovered, is that there is currently (i.e. in PDFCreator v4.1.3) no way to cancel the print job from inside my program, should the need arise. PDFCreator simply doesn't check the exit code and continues onto the next step regardless of what happened in my program.
Having exhausted the obvious options I've naturally resorted to the only way I could think of: killing the parent process from inside my app. This works, sort of. It cancels the immediate printing process.
But the problem starts again when I try to print another document. As it turns out, PDFCreator remembers the pending printing task as soon as the workflow starts. If it is killed before finishing, it stays in its queue and is retried the next time. This means the the tasks accumulate when I kill them!
I haven't had any success trying to determine where exactly the PDFCreator stores these pending tasks, so I can't delete them. And so I'm stuck.
I've raised the issue on the PDFCreator forum, but the community there seems to be rather slow to respond.