public static void Email(this PDFDocumentResult pdfDocumentResult, WorkshopSettings workshopSettings, MailSettings mailSettings) { if (pdfDocumentResult.Document == null) { return; } EmailHelper.SendEmail(workshopSettings, mailSettings, pdfDocumentResult.Document, pdfDocumentResult.FilePath); }
public static void Open(this PDFDocumentResult pdfDocumentResult) { try { Process.Start(pdfDocumentResult.FilePath); } catch { } }
public static bool Print(this PDFDocumentResult pdfDocumentResult) { if (pdfDocumentResult == null) { return(false); } if (!File.Exists(pdfDocumentResult.FilePath)) { return(false); } if (!pdfDocumentResult.Success) { return(false); } var repository = ContainerBootstrapper.Resolve <ISettingsRepository <PrinterSettings> >(); var settings = repository.GetPrinterSettings(); var parameters = new WorkerParameters(); parameters.SetParameter("FilePath", pdfDocumentResult.FilePath); parameters.SetParameter("AlwaysAskForPrinter", settings.AlwaysAskForPrinter); parameters.SetParameter("DefaultPrinterName", settings.DefaultPrinterName); parameters.SetParameter("DefaultNumberOfCopies", pdfDocumentResult.Document != null ? settings.DefaultNumberOfCopies : 1); parameters.SetParameter("LabelNumberOfCopies", settings.LabelNumberOfCopies); parameters.SetParameter("AutoClosePDFProgram", settings.AutoClosePDFProgram); parameters.SetParameter("ShowCompanyNameOnLabels", settings.ShowCompanyNameOnLabels); parameters.SetParameter("Timeout", settings.Timeout); var workerTask = new WorkerTask { TaskName = WorkerTaskName.Print }; workerTask.SetWorkerParameters(parameters); WorkerHelper.QueueTask(workerTask); return(true); }