public void AddValidExtension_GivenGoodFiles_ReturnsSameFiles()
 {
     foreach (KeyValuePair <string, OutputFormat> sample in _goodSamples)
     {
         Assert.AreEqual(OutputFormatHelper.EnsureValidExtension(sample.Key, sample.Value), sample.Key);
     }
 }
Exemple #2
0
 public ProfileChecker(IPathUtil pathUtil, IFile file, IEnumerable<ICheckable> actionChecks, OutputFormatHelper outputFormatHelper)
 {
     _pathUtil = pathUtil;
     _file = file;
     _actionChecks = actionChecks;
     _outputFormatHelper = outputFormatHelper;
 }
 public void AddValidExtension_GivenBadFiles_ReturnsGoodFiles()
 {
     foreach (KeyValuePair <string, OutputFormat> sample in _badSamples)
     {
         Assert.IsTrue(OutputFormatHelper.HasValidExtension(OutputFormatHelper.EnsureValidExtension(sample.Key, sample.Value), sample.Value));
     }
 }
        private QueryResult <OutputFilenameResult> InvokeInteraction(SaveFileInteraction interaction, OutputFormat outputFormat, bool canChangeFormat)
        {
            var result = new QueryResult <OutputFilenameResult> {
                Success = false
            };

            _interactionInvoker.Invoke(interaction);

            if (!interaction.Success)
            {
                return(result);
            }

            if (canChangeFormat)
            {
                outputFormat = (OutputFormat)interaction.FilterIndex - 1;
            }

            var outputFile         = interaction.FileName;
            var outputFormatHelper = new OutputFormatHelper();

            if (!outputFormatHelper.HasValidExtension(outputFile, outputFormat))
            {
                outputFile = outputFormatHelper.EnsureValidExtension(outputFile, outputFormat);
            }

            result.Success = true;
            result.Data    = new OutputFilenameResult(outputFile, outputFormat);
            return(result);
        }
        private bool LaunchSaveFileForRetyping(SaveFileDialog saveFileDialog)
        {
            var result = TopMostHelper.ShowDialogTopMost(saveFileDialog, !Job.Profile.SkipPrintDialog);

            if (result != DialogResult.OK)
            {
                Logger.Info("User cancelled the save dialog. No file will be created.");
                WorkflowStep = WorkflowStep.AbortedByUser;
                return(false);
            }

            try
            {
                var outputFile = saveFileDialog.FileName;
                if (!OutputFormatHelper.HasValidExtension(outputFile, Job.Profile.OutputFormat))
                {
                    outputFile = OutputFormatHelper.EnsureValidExtension(outputFile, Job.Profile.OutputFormat);
                }

                Job.OutputFilenameTemplate = outputFile;
                return(true);
            }
            catch (PathTooLongException)
            {
                Logger.Error("Filename (+ path) from savefile dialog is too long.");
                var message = _translator.GetTranslation("InteractiveWorkflow", "SelectedPathTooLong", "The total length of path and filename is too long.\r\nPlease use a shorter name.");
                var caption = _translator.GetTranslation("InteractiveWorkflow", "SelectDestination", "Select destination");
                MessageWindow.ShowTopMost(message, caption, MessageWindowButtons.OK, MessageWindowIcon.Warning);
                return(LaunchSaveFileForRetyping(saveFileDialog));
            }
        }
 public void HasValidExtension_GivenLotsOfFalseSamples_ReturnsFalse()
 {
     foreach (KeyValuePair <string, OutputFormat> sample in _badSamples)
     {
         Assert.IsFalse(OutputFormatHelper.HasValidExtension(sample.Key, sample.Value), String.Format("Sample '{0}' was deemed valid for {1}, but should be invalid.", sample.Key, sample.Value));
     }
 }
Exemple #7
0
        /// <summary>
        ///     Get the list of Ghostscript Parameters. This List contains of a basic set of parameters together with some
        ///     device-specific
        ///     parameters that will be added by the device implementation
        /// </summary>
        /// <param name="ghostscriptVersion"></param>
        /// <returns>A list of parameters that will be passed to Ghostscript</returns>
        public IList <string> GetGhostScriptParameters(GhostscriptVersion ghostscriptVersion)
        {
            IList <string> parameters = new List <string>();

            var outputFormatHelper = new OutputFormatHelper();

            parameters.Add("gs");
            parameters.Add("--permit-file-all=\"" + Job.JobTempFolder + "\\\"");
            parameters.Add("-I" + ghostscriptVersion.LibPaths);
            parameters.Add("-sFONTPATH=" + _osHelper.WindowsFontsFolder);

            parameters.Add("-dNOPAUSE");
            parameters.Add("-dBATCH");

            if (!outputFormatHelper.HasValidExtension(Job.OutputFileTemplate, Job.Profile.OutputFormat))
            {
                outputFormatHelper.EnsureValidExtension(Job.OutputFileTemplate, Job.Profile.OutputFormat);
            }

            AddOutputfileParameter(parameters);

            AddDeviceSpecificParameters(parameters);

            // Add user-defined parameters
            if (!string.IsNullOrEmpty(Job.Profile.Ghostscript.AdditionalGsParameters))
            {
                var args = _commandLineUtil.CommandLineToArgs(Job.Profile.Ghostscript.AdditionalGsParameters);
                foreach (var s in args)
                {
                    parameters.Add(s);
                }
            }

            //Dictonary-Parameters must be the last Parameters
            if (DistillerDictonaries.Count > 0)
            {
                parameters.Add("-c");
                foreach (var parameter in DistillerDictonaries)
                {
                    parameters.Add(parameter);
                }
            }

            //Don't add further paramters here, since the distiller-parameters should be the last!

            parameters.Add("-f");

            SetSourceFiles(parameters, Job);

            // Compose name of the pdfmark file based on the location and name of the inf file
            var pdfMarkFileName = PathSafe.Combine(Job.JobTempFolder, "metadata.mtd");

            CreatePdfMarksFile(pdfMarkFileName);

            // Add pdfmark file as input file to set metadata
            parameters.Add(pdfMarkFileName);

            return(parameters);
        }
Exemple #8
0
        public void HelperMethods_GetMappings_ReturnsAtLeastOneOutputFormat()
        {
            // arrange & act
            var result = OutputFormatHelper.GetMappings(_testAssembly);

            // assert
            Assert.GreaterOrEqual(result.Count(), 4);
        }
Exemple #9
0
        /// <summary>
        /// Processes <paramref name="rawAddressData"/> with the RegEx set up in <typeparamref name="TOutputFormat"/>.
        /// </summary>
        /// <remarks>The input and output manipulation functions will also be processed.</remarks>
        /// <param name="rawAddressData">The input string.</param>
        /// <exception cref="ArgumentNullException"><see cref="IOutputFormat.MatchingRegex"/> must be set up correctly in the generic class.</exception>
        /// <exception cref="MissingMemberException">Should contain at least one <see cref="RegexGroupAttribute"/>.</exception>
        /// <example>
        /// This sample shows how to call the <see cref="AddressSeparationProcessor{TOutputFormat}"/> constructor.
        /// <code>
        /// class TestClass
        /// {
        ///     static int Main()
        ///     {
        ///         var processor = new AddressSeparationProcessor{GermanSimpleOutputFormat}();
        ///         var result = processor.Process('Teststraße 123a');
        ///         var address = result.ResolvedAddress;
        ///
        ///         Console.WriteLine($"Name is {address.StreetName} with number {address.HouseNumber} and affix {address.HouseNumberAffix}");
        ///     }
        /// }
        /// </code>
        /// </example>
        /// <returns>The resolved address along with info about the processing.</returns>
        public OutputResult <TOutputFormat> Process(string rawAddressData)
        {
            // sanity check
            var outputFormatInstance = Activator.CreateInstance(typeof(TOutputFormat)) as IOutputFormat;

            _       = outputFormatInstance.MatchingRegex ?? throw new ArgumentNullException(nameof(outputFormatInstance.MatchingRegex));
            Options = Options ?? new DefaultProcessingOptions();

            // create output instance
            var outputResult = new OutputResult <TOutputFormat>(rawAddressData);

            // return empty result, if input is empty
            if (String.IsNullOrWhiteSpace(rawAddressData))
            {
                return(outputResult);
            }

            // call user defined input functions
            rawAddressData = this.ProcessInputManipulationQueue(rawAddressData);

            // get all properties w/ RegexGroupAttribute and throw exception if there is none
            var propertyRegexGroupCollection = OutputFormatHelper.GetPropertyRegexGroups(typeof(TOutputFormat));

            if (Options.ThrowIfNoRegexGroupPropertyProvided &&
                propertyRegexGroupCollection.Any() == false)
            {
                throw new MissingMemberException($"Class {typeof(TOutputFormat).Name} has no property members with {nameof(RegexGroupAttribute)}.");
            }

            // assign to Regex bindings
            var match = outputFormatInstance.MatchingRegex.Match(rawAddressData);

            if (match.Success)
            {
                foreach (var prop in propertyRegexGroupCollection)
                {
                    // get first matching group value; null, if no group is matching
                    string valueOfGroup = null;
                    do
                    {
                        // get groups one by one and manipulate if necessary
                        var currentGroup = prop.RegexGroupCollection.Dequeue();
                        valueOfGroup = match.Groups[currentGroup.RegexGroupIndex]?.Value;
                        valueOfGroup = this.ProcessOutputManipulation(valueOfGroup, currentGroup);

                        // set value to instance member
                        this.SetPropertyValue(prop.Property, outputResult.GetInstance(), valueOfGroup);
                    } while (prop.RegexGroupCollection.Count > 0 && String.IsNullOrWhiteSpace(valueOfGroup));
                }

                // set success
                outputResult.AddressHasBeenResolved = true;
            }

            // return filled instance
            return(outputResult);
        }
        public string GetChallengeOutputData()
        {
            StringBuilder builder = new StringBuilder();

            foreach (var inputParametersDict in GetInputParameters())
            {
                var challengeOutput = challengeBase.GetChallengeOutput(inputParametersDict.Value);
                builder.AppendLine(OutputFormatHelper.FormatOutput(challengeOutput, RetriveOutputMessage(challengeOutput.Output)));
            }

            return(builder.ToString());
        }
Exemple #11
0
        private string GetTargetFilenameText()
        {
            var profile = _selectedProfileProvider.SelectedProfile;

            if (profile == null)
            {
                return("");
            }

            var formatHelper = new OutputFormatHelper();

            return(formatHelper.EnsureValidExtension(profile.FileNameTemplate, profile.OutputFormat));
        }
 /// <summary>
 ///     Creates a new default viewer action.
 /// </summary>
 public DefaultViewerAction(IFileAssoc fileAssoc, IRecommendArchitect recommendArchitect,
                            IPdfArchitectCheck pdfArchitectCheck, ISettingsProvider settingsProvider,
                            OutputFormatHelper outputFormatHelper, IProcessStarter processStarter,
                            IDefaultViewerCheck defaultViewerCheck)
 {
     _fileAssoc          = fileAssoc;
     _recommendArchitect = recommendArchitect;
     _pdfArchitectCheck  = pdfArchitectCheck;
     _settingsProvider   = settingsProvider;
     _outputFormatHelper = outputFormatHelper;
     _processStarter     = processStarter;
     _defaultViewerCheck = defaultViewerCheck;
 }
Exemple #13
0
        public void HelperMethods_FindMatchingOutputFormats_ReturnsAtLeastOneOutputFormat()
        {
            // arrange & act
            var result      = OutputFormatHelper.GetCompatibleOutputFormats("Teststrasse 123", _testAssembly);
            var resultTypes = result
                              .Select(mapper => mapper.Type)
                              .ToList();

            // assert
            Assert.GreaterOrEqual(result.Count(), 3);
            Assert.Contains(typeof(InputSameAsOutputOutputFormat), resultTypes);
            Assert.Contains(typeof(InputSameAsOutputTwoGroupsOutputFormat), resultTypes);
            Assert.Contains(typeof(NoRegexGroupAttributeOutputFormat), resultTypes);
        }
        /// <summary>
        /// Processes the selected cells
        /// </summary>
        private void btnProcess_Click(object sender, RibbonControlEventArgs e)
        {
            // sanity check
            var selection = Globals.ThisAddIn.Application.Selection as Range;

            if (selection == null)
            {
                MessageBox.Show(Resources.Messages.PlaceCursorOntoAddress, Resources.Messages.ProcessTitle,
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            // get selected output format type
            string selectedOutputFormatText = cbOutputFormat.Text;
            Type   selectedOutputFormatType = _outputFormatsDictionary[selectedOutputFormatText]?.Type;

            if (selectedOutputFormatType == null)
            {
                MessageBox.Show(Resources.Messages.SelectOutputFormat, Resources.Messages.ProcessTitle,
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            // create processor
            var     queue             = GetInputManipulationQueue();
            dynamic processor         = AddressSeparationProcessorFactory.CreateInstance(selectedOutputFormatType, null, queue);
            var     matchedProperties = OutputFormatHelper.GetPropertyRegexGroups(selectedOutputFormatType).ToList();

            // try resolving every address
            foreach (Range cell in selection.Cells)
            {
                // skip empty cells
                if (cell.Value == null)
                {
                    continue;
                }

                // process address
                object address = processor.Process(cell.Value).ResolvedAddress;

                // place properties next to active cell
                for (int i = 0; i < matchedProperties.Count(); i++)
                {
                    string propertyName = matchedProperties[i].Property.Name;
                    cell.Offset[0, i + 1].Value = address.GetType()
                                                  .GetProperty(propertyName)
                                                  .GetValue(address);
                }
            }
        }
        public void SetUp()
        {
            _settings           = new PdfCreatorSettings();
            _fileAssoc          = Substitute.For <IFileAssoc>();
            _recommendArchitect = Substitute.For <IRecommendArchitect>();
            _pdfArchitectCheck  = Substitute.For <IPdfArchitectCheck>();
            _pdfArchitectCheck.GetInstallationPath().Returns(ArchitectPath);
            _settingsProvider = Substitute.For <ISettingsProvider>();
            _settingsProvider.Settings.Returns(_settings);
            _outputFormatHelper         = new OutputFormatHelper();
            _processStarter             = Substitute.For <IProcessStarter>();
            _defaultViewerCheck         = Substitute.For <IDefaultViewerCheck>();
            _defaultViewer              = new DefaultViewer();
            _defaultViewer.OutputFormat = OutputFormat.Pdf;
            _defaultViewer.Path         = DefaultViewerPath;
            _settings.DefaultViewers.Add(_defaultViewer);
            _job = new Job(new JobInfo(), new ConversionProfile(), new Accounts());

            _profile = new ConversionProfile();

            _defaultViewerAction = new DefaultViewerAction(_fileAssoc, _recommendArchitect, _pdfArchitectCheck, _settingsProvider, _outputFormatHelper, _processStarter, _defaultViewerCheck);
        }
        private QueryResult <string> InvokeInteraction(SaveFileInteraction interaction, Job job, bool canChangeFormat)
        {
            var result = new QueryResult <string> {
                Success = false
            };

            _interactionInvoker.Invoke(interaction);

            if (!interaction.Success)
            {
                return(result);
            }

            if (canChangeFormat)
            {
                job.Profile.OutputFormat = (OutputFormat)interaction.FilterIndex - 1;
            }

            try
            {
                var outputFile         = interaction.FileName;
                var outputFormatHelper = new OutputFormatHelper();
                if (!outputFormatHelper.HasValidExtension(outputFile, job.Profile.OutputFormat))
                {
                    outputFile = outputFormatHelper.EnsureValidExtension(outputFile, job.Profile.OutputFormat);
                }

                result.Success = true;
                result.Data    = outputFile;
                return(result);
            }
            catch (PathTooLongException)
            {
                NotifyUserAboutPathTooLong();
                return(InvokeInteraction(interaction, job, canChangeFormat));
            }
        }
        /// <summary>
        /// Toggle all or matching output formats.
        /// </summary>
        /// <param name="sender">Sender of type <see cref="RibbonToggleButton"/>.</param>
        /// <param name="e">Event of ribbon control.</param>
        private void toggleFindMatch_Click(object sender, RibbonControlEventArgs e)
        {
            // sanity check
            var button    = sender as RibbonToggleButton;
            var selection = Globals.ThisAddIn.Application.ActiveCell as Range;

            if (button == null || selection == null)
            {
                return;
            }

            IEnumerable <DescriptionMapper> outputFormats = null;

            if (button.Checked == false)
            {
                // show all output formats
                outputFormats = OutputFormatHelper.GetMappings();
            }
            else
            {
                // show only matching output formats
                var firstSelectedCellValue = selection?.Value as string;
                if (string.IsNullOrWhiteSpace(firstSelectedCellValue))
                {
                    button.Checked = false;
                    MessageBox.Show(
                        Resources.Messages.PlaceCursorOntoAddress, Resources.Messages.IdentifyOutputFormats,
                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                outputFormats = OutputFormatHelper.GetCompatibleOutputFormats(firstSelectedCellValue);
            }

            // repopulate dropdown
            this.PopulateOutputFormats(outputFormats);
        }
 public TargetFileNameComposer(IPathUtil pathUtil)
 {
     _pathUtil           = pathUtil;
     _outputFormatHelper = new OutputFormatHelper();
 }
Exemple #19
0
        /// <summary>
        ///     Get the list of Ghostscript Parameters. This List contains of a basic set of parameters together with some
        ///     device-specific
        ///     parameters that will be added by the device implementation
        /// </summary>
        /// <param name="ghostscriptVersion"></param>
        /// <returns>A list of parameters that will be passed to Ghostscript</returns>
        public IList <string> GetGhostScriptParameters(GhostscriptVersion ghostscriptVersion)
        {
            IList <string> parameters = new List <string>();

            var outputFormatHelper = new OutputFormatHelper();

            parameters.Add("gs");
            parameters.Add("-I" + ghostscriptVersion.LibPaths);
            parameters.Add("-sFONTPATH=" + _osHelper.WindowsFontsFolder);

            parameters.Add("-dNOPAUSE");
            parameters.Add("-dBATCH");

            if (!outputFormatHelper.HasValidExtension(Job.OutputFilenameTemplate, Job.Profile.OutputFormat))
            {
                outputFormatHelper.EnsureValidExtension(Job.OutputFilenameTemplate, Job.Profile.OutputFormat);
            }

            AddOutputfileParameter(parameters);

            AddDeviceSpecificParameters(parameters);

            // Add user-defined parameters
            if (!string.IsNullOrEmpty(Job.Profile.Ghostscript.AdditionalGsParameters))
            {
                var args = _commandLineUtil.CommandLineToArgs(Job.Profile.Ghostscript.AdditionalGsParameters);
                foreach (var s in args)
                {
                    parameters.Add(s);
                }
            }

            //Dictonary-Parameters must be the last Parameters
            if (DistillerDictonaries.Count > 0)
            {
                parameters.Add("-c");
                foreach (var parameter in DistillerDictonaries)
                {
                    parameters.Add(parameter);
                }
            }

            //Don't add further paramters here, since the distiller-parameters should be the last!

            parameters.Add("-f");

            if (Job.Profile.Stamping.Enabled)
            {
                // Compose name of the stamp file based on the location and name of the inf file
                var stampFileName = PathSafe.Combine(Job.JobTempFolder,
                                                     PathSafe.GetFileNameWithoutExtension(Job.JobInfo.InfFile) + ".stm");
                CreateStampFile(stampFileName, Job.Profile, Job.TokenReplacer);
                parameters.Add(stampFileName);
            }

            if (Job.Profile.CoverPage.Enabled)
            {
                parameters.Add(PathHelper.GetShortPathName(Job.Profile.CoverPage.File));
            }

            foreach (var sfi in Job.JobInfo.SourceFiles)
            {
                parameters.Add(PathHelper.GetShortPathName(sfi.Filename));
            }

            if (Job.Profile.AttachmentPage.Enabled)
            {
                parameters.Add(PathHelper.GetShortPathName(Job.Profile.AttachmentPage.File));
            }

            // Compose name of the pdfmark file based on the location and name of the inf file
            var pdfMarkFileName = PathSafe.Combine(Job.JobTempFolder, "metadata.mtd");

            CreatePdfMarksFile(pdfMarkFileName);

            // Add pdfmark file as input file to set metadata
            parameters.Add(pdfMarkFileName);

            return(parameters);
        }
        /// <summary>
        /// Load sequence of plugin.
        /// </summary>
        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {
            var outputFormats = OutputFormatHelper.GetMappings();

            this.PopulateOutputFormats(outputFormats);
        }
Exemple #21
0
        public PrintJobViewModel(
            ISettingsProvider settingsProvider,
            ITranslationUpdater translationUpdater,
            IJobInfoQueue jobInfoQueue,
            IFileNameQuery saveFileQuery,
            IInteractionRequest interactionRequest,
            ICommandLocator commandsLocator,
            IEventAggregator eventAggregator,
            ISelectedProfileProvider selectedProfileProvider,
            ITempFolderProvider tempFolderProvider,
            IPathUtil pathUtil,
            IFile file,
            IGpoSettings gpoSettings,
            IDispatcher dispatcher,
            IDirectoryHelper directoryHelper,
            IInteractiveProfileChecker interactiveProfileChecker)
            : base(translationUpdater)
        {
            GpoSettings              = gpoSettings;
            _settingsProvider        = settingsProvider;
            _saveFileQuery           = saveFileQuery;
            _interactionRequest      = interactionRequest;
            _selectedProfileProvider = selectedProfileProvider;
            _file = file;
            _tempFolderProvider        = tempFolderProvider;
            _pathUtil                  = pathUtil;
            _dispatcher                = dispatcher;
            _directoryHelper           = directoryHelper;
            _interactiveProfileChecker = interactiveProfileChecker;

            SaveCommand            = new DelegateCommand(SaveExecute, CanExecute);
            SendByEmailCommand     = new DelegateCommand(EmailExecute);
            MergeCommand           = new DelegateCommand(MergeExecute);
            CancelCommand          = new DelegateCommand(CancelExecute);
            SetOutputFormatCommand = new DelegateCommand <OutputFormat>(SetOutputFormatExecute);
            BrowseFileCommand      = new DelegateCommand(BrowseFileExecute);

            _outputFormatHelper = new OutputFormatHelper();

            SetupEditProfileCommand(commandsLocator, eventAggregator);

            var settings = settingsProvider.Settings?.CopyAndPreserveApplicationSettings();

            Profiles = settings?.ConversionProfiles;

            jobInfoQueue.OnNewJobInfo += (sender, args) => UpdateNumberOfPrintJobsHint(jobInfoQueue.Count);
            UpdateNumberOfPrintJobsHint(jobInfoQueue.Count);

            var profileListView = CollectionViewSource.GetDefaultView(Profiles);

            if (profileListView != null)
            {
                profileListView.CurrentChanged += (sender, args) =>
                {
                    if (Job != null)
                    {
                        OutputFormat = ((ConversionProfile)profileListView.CurrentItem).OutputFormat;
                    }
                };
            }
        }
        public void PrepareSamples()
        {
            _outputFormatHelper = new OutputFormatHelper();

            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.pdf", OutputFormat.Pdf));
            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.pdf", OutputFormat.PdfA2B));
            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.pdf", OutputFormat.PdfX));

            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.png", OutputFormat.Png));

            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.tif", OutputFormat.Tif));
            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.tiff", OutputFormat.Tif));
            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.TiFf", OutputFormat.Tif));

            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpg", OutputFormat.Jpeg));
            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpeg", OutputFormat.Jpeg));
            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.jPEG", OutputFormat.Jpeg));

            _goodSamples.Add(new KeyValuePair <string, OutputFormat>("test.txt", OutputFormat.Txt));

            _goodSamples.Add(new KeyValuePair <string, OutputFormat>(@"c:\MyFolder.Tiff\test.pdf", OutputFormat.Pdf));

            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.txt", OutputFormat.Pdf));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.txt", OutputFormat.PdfA2B));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.txt", OutputFormat.PdfX));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.txt", OutputFormat.Png));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.txt", OutputFormat.Jpeg));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.txt", OutputFormat.Tif));

            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.png", OutputFormat.Pdf));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tif", OutputFormat.Pdf));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tiff", OutputFormat.Pdf));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpg", OutputFormat.Pdf));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpeg", OutputFormat.Pdf));

            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.png", OutputFormat.PdfA2B));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tif", OutputFormat.PdfA2B));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tiff", OutputFormat.PdfA2B));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpg", OutputFormat.PdfA2B));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpeg", OutputFormat.PdfA2B));

            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.png", OutputFormat.PdfX));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tif", OutputFormat.PdfX));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tiff", OutputFormat.PdfX));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpg", OutputFormat.PdfX));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpeg", OutputFormat.PdfX));

            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.pdf", OutputFormat.Png));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tif", OutputFormat.Png));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tiff", OutputFormat.Png));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpg", OutputFormat.Png));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpeg", OutputFormat.Png));

            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.pdf", OutputFormat.Jpeg));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tif", OutputFormat.Jpeg));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.tiff", OutputFormat.Jpeg));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.png", OutputFormat.Jpeg));

            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.pdf", OutputFormat.Tif));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.png", OutputFormat.Tif));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpg", OutputFormat.Tif));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpeg", OutputFormat.Tif));
            _badSamples.Add(new KeyValuePair <string, OutputFormat>("test.jpeg", OutputFormat.Txt));
        }
Exemple #23
0
 public void PrepareSamples()
 {
     _outputFormatHelper = new OutputFormatHelper();
 }
 protected TargetFilePathComposerBase(IPathUtil pathUtil)
 {
     _pathUtil           = pathUtil;
     _outputFormatHelper = new OutputFormatHelper();
 }
Exemple #25
0
 public DefaultViewerCheck(IFile file, OutputFormatHelper outputFormatHelper)
 {
     _file = file;
     _outputFormatHelper = outputFormatHelper;
 }