Windows Develop Bookmark and Share   
 index > Windows Forms General > Remove about:blank when printing through WebBrowser
 

Remove about:blank when printing through WebBrowser

I am using the WebBrowser.Print method to print html content that I have put into the WebBrowser through setting the WebBrowser.DocumentText.

When the document prints, at the top left of the page there is the Page Title (which I can set through <head><title>) and the page count. On the bottom right is the date. On the bottom left of every page, there is the text "about:blank". Presumably this is appearing since the url for the page is not set. However, it has absolutely no relevance to my users.

So how can I get rid of about:blank (or at least replace it with something more meaningful) when printing content inserted through WebBrowser.DocumentText?
Yaakov Ellis  Monday, June 11, 2007 7:58 AM

can any body know about this. Please Help

Saqib Javed  Wednesday, September 16, 2009 5:55 AM
Hi i just find the way to Remove about:blank when printing through WebBrowser

private
void PrintReport()
{
try
{
WebChartReport.DocumentText=htmlText;
System.Drawing.Printing.
PrintDocument objPriDoc = new System.Drawing.Printing.PrintDocument();
PrintDialog objPrint = new PrintDialog();
objPriDoc.DocumentName = WebChartReport.Url.LocalPath;
objPrint.Document = objPriDoc;
DialogResult res = objPrint.ShowDialog();
if (res != DialogResult.OK)
{
return;
}
WebChartReport.Print();
}
catch (Exception exp){
MessageBox.Show(exp.Message, BusinessLayer.BusGeneral.strCompanyName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
Saqib Javed  Wednesday, September 16, 2009 7:49 AM

You can use google to search for other answers

Custom Search

More Threads

• SettingsDescriptionAttribute - How is it used?
• {SOLVED} get executable path of service
• Validating properties in a PropertyGrid control
• Changing the title text for MDI parent form
• How to use GetHicon method?
• PrintDocument...
• C# Win Forms Button
• Loading a Grid Combo Box in a DataGridView.
• BEST WAY TO DESIGN A DATABASE FILTER
• Want to Enable/Disable other forms