Silent printing

  • Thread starter Thread starter zeljko.markic
  • Start date Start date
Z

zeljko.markic

I want to implement silent printing in my project to print reports
programmatically, so that a user will not see any pop-up messages to do
with the printing process. For instance, I want to hide the "Printing
Page 1 of document.." dialog.

Curently I use .Print() method.

I found this article that solves problem within DevExp but i don't
wanna buy this component only because of this one feature... :(

http://www.devexpress.com/Support/KnowledgeBase/ShowArticle.xml?kbid=2658
 
I don't know of a way to hide this dialog. However, even if you do hide
that, if your product runs on XP service pack 2, a balloon dialog will pop
up from the system tray indicating that the document was printed. You won't
be able to turn this off at all, as it is considered a security feature
(what if some program was printing documents from your machine over and over
again?).

In the end, you won't be able to have truly silent printing.
 
Zeljko,
Set the PrintController of your PrintDocument to an instance of
StandardPrintController. The default is PrintControllerWithStatusDialog
which produces the status dialog.

Ron Allen
 
This 2 lines did the work, thanks!

doc.PrintController = new StandardPrintController();
doc.Print();

Željko
 
Now I got another problem.

User required not to print directly but first to get preview.
Again google didn't answer to my queries...

Code now looks like this:
doc.PrintController = new StandardPrintController();
printPreviewControl1.Document = doc;
printPreviewControl1.Show();

but dialog "Generating Preview..." is showed... :(
 
Mrki,
I've never tried bypassing that dialog. It is being shown by the
PrintPreviewDialog which uses its' own print controller and doesn't appear
to be changeable. You could roll your own using a PrintPrieview Control but
then you will have to code all the controls for moving through the document
as well.
Just as an aside, my users don't seem to mind seeing the generating page
# dialog and it does act as a type of progress indicator which is useful for
some of our long documents.

Ron Allen
 
Back
Top