Exemple #1
0
        public void Print()
        {
            int  numCustomers = 1;
            Font PrintFont    = new Font("Arial", 10);
            Font headFont     = new Font("Arial", 12, System.Drawing.FontStyle.Bold);

            PrintElement Header = new PrintElement(null);

            Header.AddMiddleText("Report", headFont);
            Header.AddHorizontalRule();

            PrintElement Footer = new PrintElement(null);

            Footer.AddHorizontalRule();
            Footer.AddMiddleText("Confidential", headFont);
            PrintEngine _engine = new PrintEngine(Header, Footer);

            for (int n = 0; n < numCustomers; n++)
            {
                Customer theCustomer = new Customer();
                theCustomer.Id        = n + 1;
                theCustomer.FirstName = "Darren";
                theCustomer.LastName  = "Clarke";
                theCustomer.Company   = "Madras inc.";
                theCustomer.Email     = "*****@*****.**";
                theCustomer.Phone     = "602 555 1234";

                _engine.AddPrintObject(theCustomer);
            }
            _engine.Print();
        }
Exemple #2
0
        public static void PrintTicket(PrintedBill pBill)
        {
            //pBill.Print()
            PrintEngine printEngine = new PrintEngine();

            printEngine.AddPrintObject(pBill);
            printEngine.Print();
        }
Exemple #3
0
        public PhotoWorkshopWindow()
        {
            InitializeComponent();

            engine  = new DPhotoEngine(currentImage, currentCanvas);
            printer = new PrintEngine(currentCanvas);

            BindCommands();
            RestoreProgramState();
            ApplyColorShemesToButton();
            engine.TextEngine.SetUIElements(currentFontName, currentFontSize);
            currentFontSize.SelectedIndex = 4;
        }
Exemple #4
0
 public static void PrintTicket(PrintedBill pBill)
 {
     //pBill.Print()
     try
     {
         PrintEngine printEngine = new PrintEngine();
         printEngine.AddPrintObject(pBill);
         printEngine.Print();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "打印", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #5
0
        // CreateEngine - create a print engine and populate it with customers...
        public void CreateEngine(int numCustomers)
        {
            // create a new engine...
            _engine = new PrintEngine();

            // loop through the customers...
            for (int n = 0; n < numCustomers; n++)
            {
                // create the customer...
                Customer theCustomer = new Customer();
                theCustomer.Id        = n + 1;
                theCustomer.FirstName = "Darren";
                theCustomer.LastName  = "Clarke";
                theCustomer.Company   = "Madras inc.";
                theCustomer.Email     = "*****@*****.**";
                theCustomer.Phone     = "602 555 1234";

                // add the customer to the list...
                _engine.AddPrintObject(theCustomer);
            }
        }
Exemple #6
0
 private void ImprimirComprobanteCorrespondiente(int cbteCodigo, string fileName, DataTable dtDetails, DataTable dtImpuestos, TipoDeCopia eCopia, PrintEngine.Documento newPdf)
 {
     if (EsComprobanteLocal(cbteCodigo))
     {
         switch (GetTipoDocByAfipCode(cbteCodigo))
         {
             case TipoDocAfip.Factura:
                 newPdf.ImprimirArchivoFacturaLocal(fileName, dtDetails, dtImpuestos);
                 break;
             case TipoDocAfip.NotaDeCredito:
                 newPdf.ImprimirArchivoNotaCreditoLocal(fileName, dtDetails, dtImpuestos);
                 break;
             case TipoDocAfip.NotaDeDebito:
                 newPdf.ImprimirArchivoNotaDebitoLocal(fileName, dtDetails, dtImpuestos);
                 break;
         }
     }
     else //Es Comprobante de Exportacion.
     {
         switch (GetTipoDocByAfipCode(cbteCodigo))
         {
             case TipoDocAfip.Factura:
                 newPdf.ImprimirArchivoFacturaExportacion(fileName, dtDetails, dtImpuestos);
                 break;
             case TipoDocAfip.NotaDeCredito:
                 newPdf.ImprimirArchivoNotaCreditoExportacion(fileName, dtDetails, dtImpuestos);
                 break;
             case TipoDocAfip.NotaDeDebito:
                 newPdf.ImprimirArchivoNotaDebitoExportacion(fileName, dtDetails, dtImpuestos);
                 break;
         }
     }
 }