0

I'm fairly new to C# and I'm currently working on a program that would allow the user to hit a print button. This print button (so far) creates an HTML-File. Now I'm using the WebClient-Class to read and print that HTML-Page but now I'm left with a page counter in the top right corner, the current date in the bottom right and the source-url in the bottom left.

I know that you can turn of these things when you print from your browser (Which is basically what I'm doing here, if I understood that correctly) Is there a way to not print these details? (Like changing options in my web browser that lets me do that?)

edit:

Code:

private void Print_Click(object sender, EventArgs e)
{
    wBrowser.DocumentCompleted += wBrowser_DocumentCompleted;
    wBrowser.DocumentText = System.IO.File.ReadAllText(@path);
}

void wBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
    wBrowser.Print();
}

wBrowser being my WebBrowser and path being the path were I get my HTML-File from.

Jan
  • 21
  • 5
  • http://stackoverflow.com/questions/1960939/disabling-browser-print-options-headers-footers-margins-from-page?lq=1 , This might be helpfull. I'm not that good in c# though. Although it sounds like C# has nothing to do with this. –  Apr 30 '15 at 09:32
  • What about giving us your general code which is creating the sheet? Even if it has nothing to do with your problem, I could at least try to reproduce the problem. – C4d Apr 30 '15 at 09:37
  • Well, the code would be irrelevant, as it only uses the WebClient.Print() method on an HTML-Document that is written by a StreamWriter (The HTML file works and is printed as intended when printed from any browser where you disable these options) – Jan Apr 30 '15 at 09:43

0 Answers0