Exemplo n.º 1
0
        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;
                }
            }));
        }
Exemplo n.º 2
0
        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;
                }
            }));
        }
Exemplo n.º 3
0
        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);
            }
        }