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, ""); } }
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, ""); //} }
public static void Print(ref FrameworkElement fwe) { DrawingVisual visual = PrintControlFactory.CreateDrawingVisual(fwe, fwe.ActualWidth, fwe.ActualHeight); SetUpPrint(fwe, visual); }
public static DrawingVisual GetVisual(ref Grid fwe) { return(PrintControlFactory.CreateDrawingVisual(fwe, fwe.ActualWidth, fwe.ActualHeight)); }