예제 #1
0
        private void SettingsPrint(bool preview, bool showPrintDialog)
        {
            string textToPrint = string.Empty;

            _printer.Title           = this.Text;
            _printer.ShowPageNumbers = true;
            Font fnt = new System.Drawing.Font("Lucida Console", (float)10.0);

            _printer.Font = fnt;
            textToPrint   = _textFormatter.FormatFormTextToString(this);
            if (textToPrint == string.Empty)
            {
                textToPrint = "Nothing to print.";
            }
            _printer.TextToPrint = textToPrint;
            if (preview)
            {
                _printer.ShowPrintPreview();
            }
            else
            {
                if (showPrintDialog)
                {
                    _printer.ShowPrintDialog();
                }
                else
                {
                    _printer.Print();
                }
            }
        } //end method
예제 #2
0
        //tests
        public static void PFTextPrinterTest()
        {
            PFTextPrinter printer = new PFTextPrinter();

            printer.ShowPageNumbers = true;
            printer.Title           = "TEST OUTPUT FROM TESTPROG";
            printer.TextToPrint     = "Test output\r\nPlus a second line.";

            //printer.PrintPreview(true);
            printer.ShowPrintPreview();

            //printer.ShowPrintDialog();
            //printer.Print();

            //printer.ShowPageSettings();
            //printer.Print(true);
            //printer.ShowPrintPreview();
        }
예제 #3
0
 private void FilePrint(bool preview, bool showPrintDialog)
 {
     _printer.Title           = this.Text;
     _printer.ShowPageNumbers = true;
     _printer.Font            = this.Font;
     _printer.TextToPrint     = "Testing the print function.\nThis is the second line.";
     if (preview)
     {
         _printer.ShowPrintPreview();
     }
     else
     {
         if (showPrintDialog)
         {
             _printer.ShowPrintDialog();
         }
         else
         {
             _printer.Print();
         }
     }
 }