private void ButtonPrint_Click(object sender, RoutedEventArgs e) { if (null != pdf_renderer_control_stats && null != pdf_renderer_control_stats.pdf_document) { PDFPrinter.Print(pdf_renderer_control_stats.pdf_document, pdf_renderer_control_stats.pdf_document.PDFRenderer, "PDFRenderer"); } }
private void ProcessFiles(String Destination) { while (State == EXPDFConverterState.Working && !_Aborting) { FileConversionUpdate _FileConversionUpdate = null; try { _FileConversionUpdate = new FileConversionUpdate(_FileConversionQueue.GetNext( )); _DocumentsToPrint.Add(_ConvertDocument(_FileConversionUpdate, Destination)); _InvokeFileProgressUpdateEvent(_FileConversionUpdate); } catch (Exception Ex) { if (_FileConversionUpdate is null) { _FileConversionUpdate = new FileConversionUpdate(null); _FileConversionUpdate.AddTransformation(new FileTransformation(EFileTransformation.Failed, _FileConversionUpdate.Original, null, new StateEventArgs(ESourceState.Unstable, Ex))); } _InvokeFileProgressUpdateEvent(_FileConversionUpdate); } if (_FileConversionQueue.PercentItterated == 1) { if (PrintDocuments) { Parallel.ForEach <String>(_DocumentsToPrint, new Action <String, ParallelLoopState>((String _Document, ParallelLoopState state) => { if (_Aborting) { state.Break( ); } else { if (!String.IsNullOrEmpty(_Document)) { PDFPrinter.Print(_Document, Settings.Default.SelectedPrinter); Log.Commit("Sent To Printer:\t" + _Document); } } })); Log.Commit( ); Log.Commit( ); } SetState(EXPDFConverterState.Available); } } }
private void ButtonPrint_Click(object sender, RoutedEventArgs e) { PDFDocument pdf_document = GetPDFDocument(); ASSERT.Test(pdf_document != null); if (null != pdf_document) { PDFPrinter.Print(pdf_document, "PDFRenderer"); } }
void OK() { foreach (var item in PDFFilesToPrint) { if (item.ToLower().Contains(".pdf") && PDFPrinter != null) { PDFPrinter.Print(item, SelectedPrinter, IsSetDuplex); } else if (ExcelPrinter != null) { ExcelPrinter.Print(item, SelectedPrinter, IsSetDuplex); } } }