Example #1
0
        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);
        }
Example #2
0
        ProcessingSettings GetProcessingSettings()
        {
            ProcessingSettings result = new ProcessingSettings();

            result.SetLanguage(getLanguages());
            result.SetOutputFormat(getOutputFormat());
            return(result);
        }
Example #3
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);
        }
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            Stream imageStream = AppData.Instance.Image;

            if (imageStream == null)
            {
                return;
            }

            string localPath = "image.jpg";

            saveImageToFile(imageStream, localPath);

            ProcessingSettings settings = new ProcessingSettings();

            settings.SetLanguage("English,Russian");
            settings.OutputFormat = OutputFormat.txt;

            displayMessage("Uploading..");
            abbyyClient.ProcessImageAsync(localPath, settings, settings);
        }