0

I'm using the method printWithDialog() from the AxAcroPdf control in C# which seems to return void.

When a document is printed I want to store a record of it, but I can't work out how to find out whether the user pressed Cancel or OK on the print dialog, so documents are being recorded even if the user changes their mind about printing (before the user pressed any button in fact).

Is it possible to find out whether the document was actually printed or not?

If not, can I set the printer for the AxAcroPdf control first, then just call the printAll() method to get around this issue?

4

1 回答 1

0

如果不查看打印队列(我不想这样做,因为这会导致延迟),似乎无法判断文档是否已打印。

我的解决方法是使用 aPrintDialog选择打印机,然后使用 p/invoke 将该打印机设置为默认打印机,如下所示:https://stackoverflow.com/a/971634/1341694,然后使用打印PrintAll(),将默认打印机设置回来就像后来如果它被改变了一样。

于 2014-03-06T15:49:32.087 回答