I need to get paper size by System.Drawing.Printing.PaperKind. Are there any predefined values? I don\'t want to hardcode or calculate paper sizes, I just want to get it program
public static PaperSize GetPaperSize(string Name) { PaperSize size1 = null; Name=Name.ToUpper(); PrinterSettings settings = new PrinterSettings(); foreach (PaperSize size in settings.PaperSizes) if (size.Kind.ToString().ToUpper() == Name) { size1 = size; break; } return size1; }