I have 3 printers connected to my PC and on my win form I select the print by name, in code, (I don't use PrintDialog). Every printer has different paper size (small, medium and large). Is any way I can get the paper size for current printer. I try
Console.WriteLine(e.PageSettings.Bounds.ToString());
Console.WriteLine(e.PageSettings.PaperSize.ToString());
Console.WriteLine(e.Graphics.VisibleClipBounds.ToString());
Console.WriteLine(e.Graphics.ClipBounds.ToString());
I get the variable e from my delegate parameter method:
// When I launch my printer (in class constructor):
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(PrintLabel);
//.... other code
//My delegate method:
private void PrintLabel(object o, PrintPageEventArgs e)
{
//This is my code from above:
Console.WriteLine(e.PageSettings.Bounds.ToString());
// other code
}
But it show me the same size no matter which printer I use. Thanks in advance.
e. - ANeves