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.