PrinterSettings.Kind : PrinterSettings « GUI Windows Form « C# / C Sharp






PrinterSettings.Kind

 

using System;
using System.Drawing.Printing;

class MainClass {
    static void Main(string[] args) {
        foreach (string printerName in PrinterSettings.InstalledPrinters) {
            Console.WriteLine("Printer: {0}", printerName);

            PrinterSettings printer = new PrinterSettings();
            printer.PrinterName = printerName;
            if (printer.IsValid) {
                Console.WriteLine("Supported Paper Sizes:");

                foreach (PaperSize size in printer.PaperSizes) {
                    if (Enum.IsDefined(size.Kind.GetType(), size.Kind)) {
                        Console.WriteLine("  {0}", size);
                    }
                }
            }
        }
    }
}

 








Related examples in the same category

1.PrinterResolutions
2.InstalledPrinters
3.PrinterName, IsValid printer