public static void Print(ref Grid fwe, string PrinterName) { if (fwe == null) { return; } LocalPrintServer printServer = new LocalPrintServer(); Size visualSize = new Size(fwe.ActualWidth, fwe.ActualHeight); DrawingVisual visual = PrintControlFactory.CreateDrawingVisual(fwe, fwe.ActualWidth, fwe.ActualHeight); SUT.PrintEngine.Paginators.VisualPaginator page = new SUT.PrintEngine.Paginators.VisualPaginator(visual, visualSize, new Thickness(0, 0, 0, 0), new Thickness(0, 0, 0, 0)); page.Initialize(false); PrintDialog pd = new PrintDialog(); pd.PrintQueue = printServer.GetPrintQueue(PrinterName); pd.PrintDocument(page, ""); }
public void Print(ref Grid fwe) { if (TransactionData == null) { return; } LocalPrintServer printServer = new LocalPrintServer(); Size visualSize; if (ApplicationMode == SalesRegion.ApplicationMode.Pharmacy) { visualSize = new Size(288, 2 * 96); // paper size } else { visualSize = new Size(fwe.ActualWidth, fwe.ActualHeight); } DrawingVisual visual = PrintControlFactory.CreateDrawingVisual(fwe, fwe.ActualWidth, fwe.ActualHeight); SUT.PrintEngine.Paginators.VisualPaginator page = new SUT.PrintEngine.Paginators.VisualPaginator(visual, visualSize, new Thickness(0, 0, 0, 0), new Thickness(0, 0, 0, 0)); page.Initialize(false); PrintDialog pd = new PrintDialog(); // pd.PrintQueue = printServer.GetPrintQueue(TransactionData.Station.ReceiptPrinterName); if (pd.ShowDialog() == true) { pd.PrintDocument(page, ""); } }
private static void SetUpPrint(FrameworkElement fwe, DrawingVisual visual) { Size printSize; if (fwe.ActualWidth > 1056 && fwe.ActualWidth <= 1344) { printSize = new Size(1344, 816); } else if (fwe.ActualWidth > 816 && fwe.ActualWidth <= 1056) { printSize = new Size(1056, 816); } else { printSize = new Size(816, 1056); } var page = new SUT.PrintEngine.Paginators.VisualPaginator(visual, printSize, new Thickness(0, 50, 0, 50), new Thickness(0, 0, 0, 0)); page.Initialize(false); var pd = new PrintDialog(); if (pd.ShowDialog() == true) { if (fwe.ActualWidth > 816) { pd.PrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape; } pd.PrintDocument(page, ""); } }
public void Print(ref FrameworkElement fwe) { if (TransactionData == null) { return; } //LocalPrintServer printserver = new LocalPrintServer(); PrintServer printserver = new PrintServer(Station.PrintServer); Size visualSize; visualSize = new Size(288, 2 * 96);// paper size DrawingVisual visual = PrintControlFactory.CreateDrawingVisual(fwe, fwe.ActualWidth, fwe.ActualHeight); SUT.PrintEngine.Paginators.VisualPaginator page = new SUT.PrintEngine.Paginators.VisualPaginator(visual, visualSize, new Thickness(0, 0, 0, 0), new Thickness(0, 0, 0, 0)); page.Initialize(false); PrintDialog pd = new PrintDialog(); pd.PrintQueue = printserver.GetPrintQueue(Station.ReceiptPrinterName); // pd.PrintQueue = printserver.GetPrintQueue("TSC TDP-244"); // pd.PrintQueue = printServer.GetPrintQueues(new [] {EnumeratedPrintQueueTypes.Shared} ); //if (pd.ShowDialog()==true) //{ pd.PrintDocument(page, ""); //} }