public Task <Stream> PrintInstances(string authenticationCookie, string[] instanceUIDs, PrintOptions options) { return(Task.Factory.StartNew <Stream>(() => { try { string annotationData = string.Empty; if (options.BurnAnnotations) { annotationData = LoadAnnotations(options.AnnotationsFileName); } var userName = AuthHandler.Authorize(authenticationCookie, PermissionsTable.Instance.CanExport); var pdf = _exportAddin.PrintInstances(userName, instanceUIDs, options, annotationData); return pdf; } catch { return null; } })); }
public Task <string> PrintInstances(string authenticationCookie, string[] instanceUIDs, PrintOptions options) { return(Task.Factory.StartNew(() => { try { string annotationData = string.Empty; if (options.BurnAnnotations) { annotationData = LoadAnnotations(options.AnnotationsFileName); } var userName = AuthHandler.Authorize(authenticationCookie, PermissionsTable.Instance.CanExport); var pdf = _exportAddin.PrintInstances(userName, instanceUIDs, options, annotationData); string url = Save(authenticationCookie, "Instances_", ".pdf", pdf); pdf.Dispose(); return url; } catch { return string.Empty; } })); }
public string PrintInstances(string authenticationCookie, string[] instanceUIDs, PrintOptions options) { try { Stream pdf; string annotationData = string.Empty; if (options.BurnAnnotations) { annotationData = LoadAnnotations(options.AnnotationsFileName); } var userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanExport); pdf = _exportAddin.PrintInstances(userName, instanceUIDs, options, annotationData); string url = SavePdf("Instances", pdf); pdf.Dispose(); return(url); } catch { return(string.Empty); } }