Hello all,
My application prints my windows form. When they click on the print button it does NOT give the customer the choice to select the printer or alter defaults. In this example, there is only 1 printer they can print too and it is hard coded into the code (we'll ignore the dangers of doing it this way for the moment ;) )
I want to force the height and width of the print out to 'overwrite' the printers default settings.
Despite my code telling the printer what WxH to use, it seems to revert to the default.
Any ideas?
Dave
My application prints my windows form. When they click on the print button it does NOT give the customer the choice to select the printer or alter defaults. In this example, there is only 1 printer they can print too and it is hard coded into the code (we'll ignore the dangers of doing it this way for the moment ;) )
I want to force the height and width of the print out to 'overwrite' the printers default settings.
Code:
PrintDocument pd = new PrintDocument();
PaperSize ps = new PaperSize("Custom", 100, 100);
pd.PrintPage += new PrintPageEventHandler(printInfo);
pd.PrinterSettings.PrinterName = selectedPrinter;
pd.PrinterSettings.DefaultPageSettings.PaperSize = ps;
//pd.PrinterSettings.DefaultPageSettings.PaperSize.Height = 100;
// pd.PrinterSettings.DefaultPageSettings.PaperSize.Width = 100;
lb.Text = pd.PrinterSettings.DefaultPageSettings.PaperSize.ToString();
pd.print()
Any ideas?
Dave
Comment