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); }
private static ProcessingSettings buildSettings(string language, string outputFormat) { ProcessingSettings settings = new ProcessingSettings(); settings.SetLanguage( language ); switch (outputFormat.ToLower()) { case "txt": settings.OutputFormat = OutputFormat.txt; break; case "rtf": settings.OutputFormat = OutputFormat.rtf; break; case "docx": settings.OutputFormat = OutputFormat.docx; break; case "xlsx": settings.OutputFormat = OutputFormat.xlsx; break; case "pptx": settings.OutputFormat = OutputFormat.pptx; break; case "pdfsearchable": settings.OutputFormat = OutputFormat.pdfSearchable; break; case "pdftextandimages": settings.OutputFormat = OutputFormat.pdfTextAndImages; break; case "xml": settings.OutputFormat = OutputFormat.xml; break; default: throw new ArgumentException("Invalid output format"); } return settings; }
ProcessingSettings GetProcessingSettings() { ProcessingSettings result = new ProcessingSettings(); result.SetLanguage(getLanguages()); result.SetOutputFormat( getOutputFormat() ); return result; }
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; }