Esempio n. 1
0
        private bool canConvertToPdfProof()
        {
            var test1 = StaticSystemTests.IsGhostscriptInstalled();

            return(
                SelectedFile != null &&
                StaticSystemTests.Is554KonicaPrintToFileDriverInstalled() &&
                StaticSystemTests.IsGhostscriptInstalled());
        }
        private void combineFilesConvertedToPdf_Ordered()
        {
            ModalOverlayIsVisible      = false;
            SetFileOrderModalIsVisible = false;
            UpdateLabelPdf             = "";

            try
            {
                var combined_file_names = new List <string>();
                var combine_files       = FilesConvertedToPdf_Ordered.ToList();

                var ticket_atty   = FilesConvertedToPdf.Where(x => !string.IsNullOrEmpty(x.TicketPlusAttorney)).Select(x => x.TicketPlusAttorney).FirstOrDefault();
                var new_file_name = PdfUtilities.GenerateFilenameForNewPdf(DestinationFolderConvertedFiles, "CombinedPdf", ticket_atty);

                if (StaticSystemTests.IsAdobePdfPrinterAvailable())
                {
                    // create combined pdf
                    Models.MergePdf.SimpleMergedPdf simpleMergedPdf;
                    if (!string.IsNullOrEmpty(new_file_name))
                    {
                        simpleMergedPdf = new Models.MergePdf.SimpleMergedPdf(combine_files, "Acrobat", true, new_file_name);
                    }
                    else
                    {
                        simpleMergedPdf = new Models.MergePdf.SimpleMergedPdf(combine_files, "Acrobat", true);
                    }

                    // add new file to FilesConvertedToPdf collection
                    if (System.IO.File.Exists(simpleMergedPdf?.NewCombinedFile))
                    {
                        if (!FilesConvertedToPdf.Any(x => x.FullName == simpleMergedPdf.NewCombinedFile))
                        {
                            FilesConvertedToPdf.Add(new CockleFilePdf(simpleMergedPdf.NewCombinedFile, SourceFileTypeEnum.Combined_Pdf));
                            UpdateLabelPdf = "Created: " + simpleMergedPdf.NewCombinedFile;
                        }
                    }
                }
                else // using PdfSharp or iTextSharp ???
                {
                    //combined_file_name = new SimpleMergedPdf(SelectedPdfFiles, "PdfSharp").NewCombinedFile;
                    //var combined_file = new SimpleMergedPdf(SelectedPdfFiles, "iTextSharp").NewFileName;
                }
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
                UpdateLabelPdf = ex.Message;
            }
        }
Esempio n. 3
0
 private bool canConvertFilesToPdf()
 {
     return(SelectedFile != null && !IsExecutingSearch && !IsConvertingToPdf &&
            StaticSystemTests.IsAdobePdfPrinterAvailable());
 }