示例#1
0
        private void PrintLabels(IList <QLabel> labels)
        {
            PageSetupDialog pageDialog1 = new PageSetupDialog();

            LabelPrinter labelPrinter = new LabelPrinter(labels, "QuickLabel document");

            pageDialog1.Document = labelPrinter;

            //eventueel standaard printer instellen
            bool printerAndPaperSelected = PrinterHelper.HandlePrinterAndPaperSettings(pageDialog1, labelPrinter, config.Printer);

            printDialog1.Document = labelPrinter;
            printDialog1.Document.DefaultPageSettings.Landscape = config.Printer.Landscape;
            printDialog1.AllowSelection = false;
            printDialog1.AllowSomePages = false;

            PrinterHelper.PrintWithOrWithoutDialog(config.Printer, printerAndPaperSelected, labelPrinter, printDialog1);
        }