Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.
« »

Printing without the status dialog

Blogged by Björn Meyer on February 07, 2007 and tagged with Printing, Samples, .NET, suppress printing now.

The default print controller of .NET displays a status dialog that shows the status of the printing process like this:

'Page 5 of document'

If you want to print without such a print status dialog, you will need to use the StandardPrintController instead of the default PrintControllerWithStatusDialog. The StandardPrintController is part of the System.Drawing.Printing namespace. The following code prints the content of TX Text Control without such print status dialog:

PrintDocument printDoc = new PrintDocument();
PrintController printCtl = new StandardPrintController();
printDoc.PrintController = printCtl;

textControl1.Print(printDoc);

Feel free to contact me, if you have any questions or would like to discuss further printing possibilities of TX Text Control.

« Prev:How to select the currently visible text
» Next:TX Text Control .NET 64-bit in development

Comments

If you would like to comment on this blog entry, please post a comment.

Posted by Justin on Friday, October 12, 2007 at 09:09:55:

Can this be achieved in vb.net?? Can you provide the code.

Posted by David on Thursday, January 03, 2008 at 15:56:36:

I have problem with printing WITHOUT showing the txtextcontrol (tables in document are "broken"). If I show control (and content) before printing, document print just fine.
Sample:
private void Print()
{
TxTextControl ctrl = new TxTextControl();
ctrl.Load(@"c:\test.rtf", StreamType.RichTextFormat);
ctrl.Print("test"); //or with PrintDocument()
}
I also tray to set control page margin with LoadSettings.Margins and also don't work.
(Tables has fixed size.)
Can anyone help.
David

Posted by Björn Meyer on Thursday, January 03, 2008 at 17:09:45:

Hello David
It is not possible to use the TextControl class without being visible on a form. In this case, you need to use the ServerTextControl class that can be initialized invisible without a form.
External verification page for ISO 9000:2000 certificate
ISO 9001:2000
certified