Exemple #1
0
        private static ProcessingSettings buildSettings(string language,
            string outputFormat, string profile)
        {
            ProcessingSettings settings = new ProcessingSettings();
            settings.SetLanguage( language );
            switch (outputFormat.ToLower())
            {
                case "txt": settings.SetOutputFormat(OutputFormat.txt); break;
                case "rtf": settings.SetOutputFormat( OutputFormat.rtf); break;
                case "docx": settings.SetOutputFormat( OutputFormat.docx); break;
                case "xlsx": settings.SetOutputFormat( OutputFormat.xlsx); break;
                case "pptx": settings.SetOutputFormat( OutputFormat.pptx); break;
                case "pdfsearchable": settings.SetOutputFormat( OutputFormat.pdfSearchable); break;
                case "pdftextandimages": settings.SetOutputFormat( OutputFormat.pdfTextAndImages); break;
                case "xml": settings.SetOutputFormat( OutputFormat.xml); break;
                default:
                    throw new ArgumentException("Invalid output format");
            }
            if (profile != null)
            {
                switch (profile.ToLower())
                {
                    case "documentconversion":
                        settings.Profile = Profile.documentConversion;
                        break;
                    case "documentarchiving":
                        settings.Profile = Profile.documentArchiving;
                        break;
                    case "textextraction":
                        settings.Profile = Profile.textExtraction;
                        break;
                    default:
                        throw new ArgumentException("Invalid profile");
                }
            }

            return settings;
        }
Exemple #2
0
 ProcessingSettings GetProcessingSettings()
 {
     ProcessingSettings result = new ProcessingSettings();
     result.SetLanguage(getLanguages());
     result.SetOutputFormat( getOutputFormat() );
     return result;
 }
        private static ProcessingSettings buildSettings(string language, string outputFormat)
        {
            ProcessingSettings settings = new ProcessingSettings();
            settings.SetLanguage( language );
            switch (outputFormat.ToLower())
            {
                case "txt": settings.SetOutputFormat(OutputFormat.txt); break;
                case "rtf": settings.SetOutputFormat( OutputFormat.rtf); break;
                case "docx": settings.SetOutputFormat( OutputFormat.docx); break;
                case "xlsx": settings.SetOutputFormat( OutputFormat.xlsx); break;
                case "pptx": settings.SetOutputFormat( OutputFormat.pptx); break;
                case "pdfsearchable": settings.SetOutputFormat( OutputFormat.pdfSearchable); break;
                case "pdftextandimages": settings.SetOutputFormat( OutputFormat.pdfTextAndImages); break;
                case "xml": settings.SetOutputFormat( OutputFormat.xml); break;
                default:
                    throw new ArgumentException("Invalid output format");
            }

            return settings;
        }