public PrinterSettings() { printer = PMPrinterEx.DefaultPrinter(); printer_name = printer?.Name; page_settings = new PageSettings(this); //PaperSizes = new PaperSizeCollection(new[] { new PaperSize("Letter", (int)(8.5f * 72f), (int)(11f * 72f)) }); PaperSources = new PaperSourceCollection(new PaperSource[] { }); }
public PrinterSettings() { if (PMServer.CreatePrinterList(out PMPrinter[] printers) == 0) { printer = printers.FirstOrDefault(x => x.IsDefault); } printer_name = printer?.Name; page_settings = new PageSettings(this); //PaperSizes = new PaperSizeCollection(new[] { new PaperSize("Letter", (int)(8.5f * 72f), (int)(11f * 72f)) }); PaperSources = new PaperSourceCollection(new PaperSource[] { }); }