cloudmersive-ocr-api-client 1.5.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. metadata +3 -109
  3. data/Gemfile +0 -7
  4. data/README.md +0 -150
  5. data/Rakefile +0 -8
  6. data/cloudmersive-ocr-api-client.gemspec +0 -45
  7. data/docs/BusinessCardRecognitionResult.md +0 -15
  8. data/docs/FieldResult.md +0 -9
  9. data/docs/FormDefinitionTemplate.md +0 -9
  10. data/docs/FormFieldDefinition.md +0 -25
  11. data/docs/FormRecognitionResult.md +0 -12
  12. data/docs/FormTableColumnDefinition.md +0 -13
  13. data/docs/FormTableDefinition.md +0 -11
  14. data/docs/GetPageAngleResult.md +0 -9
  15. data/docs/ImageOcrApi.md +0 -571
  16. data/docs/ImageToLinesWithLocationResult.md +0 -9
  17. data/docs/ImageToTextResponse.md +0 -9
  18. data/docs/ImageToWordsWithLocationResult.md +0 -9
  19. data/docs/OcrLineElement.md +0 -9
  20. data/docs/OcrPageResult.md +0 -10
  21. data/docs/OcrPageResultWithLinesWithLocation.md +0 -10
  22. data/docs/OcrPageResultWithWordsWithLocation.md +0 -10
  23. data/docs/OcrPhotoTextElement.md +0 -14
  24. data/docs/OcrWordElement.md +0 -18
  25. data/docs/PdfOcrApi.md +0 -191
  26. data/docs/PdfToLinesWithLocationResult.md +0 -9
  27. data/docs/PdfToTextResponse.md +0 -9
  28. data/docs/PdfToWordsWithLocationResult.md +0 -9
  29. data/docs/PhotoToWordsWithLocationResult.md +0 -10
  30. data/docs/Point.md +0 -9
  31. data/docs/PreprocessingApi.md +0 -338
  32. data/docs/ReceiptLineItem.md +0 -9
  33. data/docs/ReceiptRecognitionResult.md +0 -16
  34. data/docs/ReceiptsApi.md +0 -63
  35. data/docs/TableCellResult.md +0 -9
  36. data/docs/TableResult.md +0 -9
  37. data/docs/TableRowResult.md +0 -8
  38. data/git_push.sh +0 -55
  39. data/lib/cloudmersive-ocr-api-client.rb +0 -70
  40. data/lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb +0 -605
  41. data/lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb +0 -212
  42. data/lib/cloudmersive-ocr-api-client/api/preprocessing_api.rb +0 -359
  43. data/lib/cloudmersive-ocr-api-client/api/receipts_api.rb +0 -79
  44. data/lib/cloudmersive-ocr-api-client/api_client.rb +0 -389
  45. data/lib/cloudmersive-ocr-api-client/api_error.rb +0 -38
  46. data/lib/cloudmersive-ocr-api-client/configuration.rb +0 -209
  47. data/lib/cloudmersive-ocr-api-client/models/business_card_recognition_result.rb +0 -259
  48. data/lib/cloudmersive-ocr-api-client/models/field_result.rb +0 -201
  49. data/lib/cloudmersive-ocr-api-client/models/form_definition_template.rb +0 -203
  50. data/lib/cloudmersive-ocr-api-client/models/form_field_definition.rb +0 -361
  51. data/lib/cloudmersive-ocr-api-client/models/form_recognition_result.rb +0 -235
  52. data/lib/cloudmersive-ocr-api-client/models/form_table_column_definition.rb +0 -239
  53. data/lib/cloudmersive-ocr-api-client/models/form_table_definition.rb +0 -221
  54. data/lib/cloudmersive-ocr-api-client/models/get_page_angle_result.rb +0 -199
  55. data/lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb +0 -201
  56. data/lib/cloudmersive-ocr-api-client/models/image_to_text_response.rb +0 -199
  57. data/lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb +0 -201
  58. data/lib/cloudmersive-ocr-api-client/models/ocr_line_element.rb +0 -201
  59. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result.rb +0 -209
  60. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_lines_with_location.rb +0 -211
  61. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_words_with_location.rb +0 -211
  62. data/lib/cloudmersive-ocr-api-client/models/ocr_photo_text_element.rb +0 -251
  63. data/lib/cloudmersive-ocr-api-client/models/ocr_word_element.rb +0 -289
  64. data/lib/cloudmersive-ocr-api-client/models/pdf_to_lines_with_location_result.rb +0 -201
  65. data/lib/cloudmersive-ocr-api-client/models/pdf_to_text_response.rb +0 -201
  66. data/lib/cloudmersive-ocr-api-client/models/pdf_to_words_with_location_result.rb +0 -201
  67. data/lib/cloudmersive-ocr-api-client/models/photo_to_words_with_location_result.rb +0 -227
  68. data/lib/cloudmersive-ocr-api-client/models/point.rb +0 -199
  69. data/lib/cloudmersive-ocr-api-client/models/receipt_line_item.rb +0 -199
  70. data/lib/cloudmersive-ocr-api-client/models/receipt_recognition_result.rb +0 -271
  71. data/lib/cloudmersive-ocr-api-client/models/table_cell_result.rb +0 -201
  72. data/lib/cloudmersive-ocr-api-client/models/table_result.rb +0 -201
  73. data/lib/cloudmersive-ocr-api-client/models/table_row_result.rb +0 -191
  74. data/lib/cloudmersive-ocr-api-client/version.rb +0 -15
  75. data/spec/api/image_ocr_api_spec.rb +0 -169
  76. data/spec/api/pdf_ocr_api_spec.rb +0 -78
  77. data/spec/api/preprocessing_api_spec.rb +0 -107
  78. data/spec/api/receipts_api_spec.rb +0 -47
  79. data/spec/api_client_spec.rb +0 -226
  80. data/spec/configuration_spec.rb +0 -42
  81. data/spec/models/business_card_recognition_result_spec.rb +0 -84
  82. data/spec/models/field_result_spec.rb +0 -48
  83. data/spec/models/form_definition_template_spec.rb +0 -48
  84. data/spec/models/form_field_definition_spec.rb +0 -144
  85. data/spec/models/form_recognition_result_spec.rb +0 -66
  86. data/spec/models/form_table_column_definition_spec.rb +0 -72
  87. data/spec/models/form_table_definition_spec.rb +0 -60
  88. data/spec/models/get_page_angle_result_spec.rb +0 -48
  89. data/spec/models/image_to_lines_with_location_result_spec.rb +0 -48
  90. data/spec/models/image_to_text_response_spec.rb +0 -48
  91. data/spec/models/image_to_words_with_location_result_spec.rb +0 -48
  92. data/spec/models/ocr_line_element_spec.rb +0 -48
  93. data/spec/models/ocr_page_result_spec.rb +0 -54
  94. data/spec/models/ocr_page_result_with_lines_with_location_spec.rb +0 -54
  95. data/spec/models/ocr_page_result_with_words_with_location_spec.rb +0 -54
  96. data/spec/models/ocr_photo_text_element_spec.rb +0 -78
  97. data/spec/models/ocr_word_element_spec.rb +0 -102
  98. data/spec/models/pdf_to_lines_with_location_result_spec.rb +0 -48
  99. data/spec/models/pdf_to_text_response_spec.rb +0 -48
  100. data/spec/models/pdf_to_words_with_location_result_spec.rb +0 -48
  101. data/spec/models/photo_to_words_with_location_result_spec.rb +0 -54
  102. data/spec/models/point_spec.rb +0 -48
  103. data/spec/models/receipt_line_item_spec.rb +0 -48
  104. data/spec/models/receipt_recognition_result_spec.rb +0 -90
  105. data/spec/models/table_cell_result_spec.rb +0 -48
  106. data/spec/models/table_result_spec.rb +0 -48
  107. data/spec/models/table_row_result_spec.rb +0 -42
  108. data/spec/spec_helper.rb +0 -111
@@ -1,212 +0,0 @@
1
- =begin
2
- #ocrapi
3
-
4
- #The powerful Optical Character Recognition (OCR) APIs let you convert scanned images of pages into recognized text.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require "uri"
14
-
15
- module CloudmersiveOcrApiClient
16
- class PdfOcrApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
-
23
- # Convert a PDF into text lines with location
24
- # Converts a PDF into lines/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
25
- # @param image_file PDF file to perform OCR on.
26
- # @param [Hash] opts the optional parameters
27
- # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
28
- # @option opts [String] :preprocessing Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
29
- # @return [PdfToLinesWithLocationResult]
30
- def pdf_ocr_pdf_to_lines_with_location(image_file, opts = {})
31
- data, _status_code, _headers = pdf_ocr_pdf_to_lines_with_location_with_http_info(image_file, opts)
32
- return data
33
- end
34
-
35
- # Convert a PDF into text lines with location
36
- # Converts a PDF into lines/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
37
- # @param image_file PDF file to perform OCR on.
38
- # @param [Hash] opts the optional parameters
39
- # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
40
- # @option opts [String] :preprocessing Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
41
- # @return [Array<(PdfToLinesWithLocationResult, Fixnum, Hash)>] PdfToLinesWithLocationResult data, response status code and response headers
42
- def pdf_ocr_pdf_to_lines_with_location_with_http_info(image_file, opts = {})
43
- if @api_client.config.debugging
44
- @api_client.config.logger.debug "Calling API: PdfOcrApi.pdf_ocr_pdf_to_lines_with_location ..."
45
- end
46
- # verify the required parameter 'image_file' is set
47
- if @api_client.config.client_side_validation && image_file.nil?
48
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PdfOcrApi.pdf_ocr_pdf_to_lines_with_location"
49
- end
50
- # resource path
51
- local_var_path = "/ocr/pdf/to/lines-with-location"
52
-
53
- # query parameters
54
- query_params = {}
55
-
56
- # header parameters
57
- header_params = {}
58
- # HTTP header 'Accept' (if needed)
59
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
60
- # HTTP header 'Content-Type'
61
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
62
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
63
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
64
-
65
- # form parameters
66
- form_params = {}
67
- form_params["imageFile"] = image_file
68
-
69
- # http body (model)
70
- post_body = nil
71
- auth_names = ['Apikey']
72
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
73
- :header_params => header_params,
74
- :query_params => query_params,
75
- :form_params => form_params,
76
- :body => post_body,
77
- :auth_names => auth_names,
78
- :return_type => 'PdfToLinesWithLocationResult')
79
- if @api_client.config.debugging
80
- @api_client.config.logger.debug "API called: PdfOcrApi#pdf_ocr_pdf_to_lines_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
- end
82
- return data, status_code, headers
83
- end
84
-
85
- # Convert a PDF into words with location
86
- # Converts a PDF into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
87
- # @param image_file PDF file to perform OCR on.
88
- # @param [Hash] opts the optional parameters
89
- # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
90
- # @option opts [String] :preprocessing Optional, preprocessing mode, default is &#39;Auto&#39;. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
91
- # @return [PdfToWordsWithLocationResult]
92
- def pdf_ocr_pdf_to_words_with_location(image_file, opts = {})
93
- data, _status_code, _headers = pdf_ocr_pdf_to_words_with_location_with_http_info(image_file, opts)
94
- return data
95
- end
96
-
97
- # Convert a PDF into words with location
98
- # Converts a PDF into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
99
- # @param image_file PDF file to perform OCR on.
100
- # @param [Hash] opts the optional parameters
101
- # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
102
- # @option opts [String] :preprocessing Optional, preprocessing mode, default is &#39;Auto&#39;. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
103
- # @return [Array<(PdfToWordsWithLocationResult, Fixnum, Hash)>] PdfToWordsWithLocationResult data, response status code and response headers
104
- def pdf_ocr_pdf_to_words_with_location_with_http_info(image_file, opts = {})
105
- if @api_client.config.debugging
106
- @api_client.config.logger.debug "Calling API: PdfOcrApi.pdf_ocr_pdf_to_words_with_location ..."
107
- end
108
- # verify the required parameter 'image_file' is set
109
- if @api_client.config.client_side_validation && image_file.nil?
110
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PdfOcrApi.pdf_ocr_pdf_to_words_with_location"
111
- end
112
- # resource path
113
- local_var_path = "/ocr/pdf/to/words-with-location"
114
-
115
- # query parameters
116
- query_params = {}
117
-
118
- # header parameters
119
- header_params = {}
120
- # HTTP header 'Accept' (if needed)
121
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
122
- # HTTP header 'Content-Type'
123
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
124
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
125
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
126
-
127
- # form parameters
128
- form_params = {}
129
- form_params["imageFile"] = image_file
130
-
131
- # http body (model)
132
- post_body = nil
133
- auth_names = ['Apikey']
134
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
135
- :header_params => header_params,
136
- :query_params => query_params,
137
- :form_params => form_params,
138
- :body => post_body,
139
- :auth_names => auth_names,
140
- :return_type => 'PdfToWordsWithLocationResult')
141
- if @api_client.config.debugging
142
- @api_client.config.logger.debug "API called: PdfOcrApi#pdf_ocr_pdf_to_words_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
- end
144
- return data, status_code, headers
145
- end
146
-
147
- # Converts an uploaded PDF file into text via Optical Character Recognition.
148
- #
149
- # @param image_file PDF file to perform OCR on.
150
- # @param [Hash] opts the optional parameters
151
- # @option opts [String] :recognition_mode Optional; possible values are &#39;Basic&#39; which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls per page; &#39;Normal&#39; which provides highly fault tolerant OCR recognition uses 14-16 API calls per page; and &#39;Advanced&#39; which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls per page. Default recognition mode is &#39;Basic&#39;
152
- # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
153
- # @option opts [String] :preprocessing Optional, preprocessing mode, default is &#39;Auto&#39;. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
154
- # @return [PdfToTextResponse]
155
- def pdf_ocr_post(image_file, opts = {})
156
- data, _status_code, _headers = pdf_ocr_post_with_http_info(image_file, opts)
157
- return data
158
- end
159
-
160
- # Converts an uploaded PDF file into text via Optical Character Recognition.
161
- #
162
- # @param image_file PDF file to perform OCR on.
163
- # @param [Hash] opts the optional parameters
164
- # @option opts [String] :recognition_mode Optional; possible values are &#39;Basic&#39; which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls per page; &#39;Normal&#39; which provides highly fault tolerant OCR recognition uses 14-16 API calls per page; and &#39;Advanced&#39; which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls per page. Default recognition mode is &#39;Basic&#39;
165
- # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
166
- # @option opts [String] :preprocessing Optional, preprocessing mode, default is &#39;Auto&#39;. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
167
- # @return [Array<(PdfToTextResponse, Fixnum, Hash)>] PdfToTextResponse data, response status code and response headers
168
- def pdf_ocr_post_with_http_info(image_file, opts = {})
169
- if @api_client.config.debugging
170
- @api_client.config.logger.debug "Calling API: PdfOcrApi.pdf_ocr_post ..."
171
- end
172
- # verify the required parameter 'image_file' is set
173
- if @api_client.config.client_side_validation && image_file.nil?
174
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PdfOcrApi.pdf_ocr_post"
175
- end
176
- # resource path
177
- local_var_path = "/ocr/pdf/toText"
178
-
179
- # query parameters
180
- query_params = {}
181
-
182
- # header parameters
183
- header_params = {}
184
- # HTTP header 'Accept' (if needed)
185
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
186
- # HTTP header 'Content-Type'
187
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
188
- header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
189
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
190
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
191
-
192
- # form parameters
193
- form_params = {}
194
- form_params["imageFile"] = image_file
195
-
196
- # http body (model)
197
- post_body = nil
198
- auth_names = ['Apikey']
199
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
200
- :header_params => header_params,
201
- :query_params => query_params,
202
- :form_params => form_params,
203
- :body => post_body,
204
- :auth_names => auth_names,
205
- :return_type => 'PdfToTextResponse')
206
- if @api_client.config.debugging
207
- @api_client.config.logger.debug "API called: PdfOcrApi#pdf_ocr_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
- end
209
- return data, status_code, headers
210
- end
211
- end
212
- end
@@ -1,359 +0,0 @@
1
- =begin
2
- #ocrapi
3
-
4
- #The powerful Optical Character Recognition (OCR) APIs let you convert scanned images of pages into recognized text.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require "uri"
14
-
15
- module CloudmersiveOcrApiClient
16
- class PreprocessingApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
-
23
- # Convert an image of text into a binarized (light and dark) view
24
- # Perform an adaptive binarization algorithm on the input image to prepare it for further OCR operations.
25
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
26
- # @param [Hash] opts the optional parameters
27
- # @return [String]
28
- def preprocessing_binarize(image_file, opts = {})
29
- data, _status_code, _headers = preprocessing_binarize_with_http_info(image_file, opts)
30
- return data
31
- end
32
-
33
- # Convert an image of text into a binarized (light and dark) view
34
- # Perform an adaptive binarization algorithm on the input image to prepare it for further OCR operations.
35
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
36
- # @param [Hash] opts the optional parameters
37
- # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
38
- def preprocessing_binarize_with_http_info(image_file, opts = {})
39
- if @api_client.config.debugging
40
- @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_binarize ..."
41
- end
42
- # verify the required parameter 'image_file' is set
43
- if @api_client.config.client_side_validation && image_file.nil?
44
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PreprocessingApi.preprocessing_binarize"
45
- end
46
- # resource path
47
- local_var_path = "/ocr/preprocessing/image/binarize"
48
-
49
- # query parameters
50
- query_params = {}
51
-
52
- # header parameters
53
- header_params = {}
54
- # HTTP header 'Accept' (if needed)
55
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
56
- # HTTP header 'Content-Type'
57
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
58
-
59
- # form parameters
60
- form_params = {}
61
- form_params["imageFile"] = image_file
62
-
63
- # http body (model)
64
- post_body = nil
65
- auth_names = ['Apikey']
66
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
67
- :header_params => header_params,
68
- :query_params => query_params,
69
- :form_params => form_params,
70
- :body => post_body,
71
- :auth_names => auth_names,
72
- :return_type => 'String')
73
- if @api_client.config.debugging
74
- @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_binarize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
- end
76
- return data, status_code, headers
77
- end
78
-
79
- # Convert an image of text into a binary (light and dark) view with ML
80
- # Perform an advanced adaptive, Deep Learning-based binarization algorithm on the input image to prepare it for further OCR operations. Provides enhanced accuracy than adaptive binarization. Image will be upsampled to 300 DPI if it has a DPI below 300.
81
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
82
- # @param [Hash] opts the optional parameters
83
- # @return [String]
84
- def preprocessing_binarize_advanced(image_file, opts = {})
85
- data, _status_code, _headers = preprocessing_binarize_advanced_with_http_info(image_file, opts)
86
- return data
87
- end
88
-
89
- # Convert an image of text into a binary (light and dark) view with ML
90
- # Perform an advanced adaptive, Deep Learning-based binarization algorithm on the input image to prepare it for further OCR operations. Provides enhanced accuracy than adaptive binarization. Image will be upsampled to 300 DPI if it has a DPI below 300.
91
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
92
- # @param [Hash] opts the optional parameters
93
- # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
94
- def preprocessing_binarize_advanced_with_http_info(image_file, opts = {})
95
- if @api_client.config.debugging
96
- @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_binarize_advanced ..."
97
- end
98
- # verify the required parameter 'image_file' is set
99
- if @api_client.config.client_side_validation && image_file.nil?
100
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PreprocessingApi.preprocessing_binarize_advanced"
101
- end
102
- # resource path
103
- local_var_path = "/ocr/preprocessing/image/binarize/advanced"
104
-
105
- # query parameters
106
- query_params = {}
107
-
108
- # header parameters
109
- header_params = {}
110
- # HTTP header 'Accept' (if needed)
111
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
112
- # HTTP header 'Content-Type'
113
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
114
-
115
- # form parameters
116
- form_params = {}
117
- form_params["imageFile"] = image_file
118
-
119
- # http body (model)
120
- post_body = nil
121
- auth_names = ['Apikey']
122
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
123
- :header_params => header_params,
124
- :query_params => query_params,
125
- :form_params => form_params,
126
- :body => post_body,
127
- :auth_names => auth_names,
128
- :return_type => 'String')
129
- if @api_client.config.debugging
130
- @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_binarize_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
131
- end
132
- return data, status_code, headers
133
- end
134
-
135
- # Get the angle of the page / document / receipt
136
- # Analyzes a photo or image of a document and identifies the rotation angle of the page.
137
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
138
- # @param [Hash] opts the optional parameters
139
- # @return [GetPageAngleResult]
140
- def preprocessing_get_page_angle(image_file, opts = {})
141
- data, _status_code, _headers = preprocessing_get_page_angle_with_http_info(image_file, opts)
142
- return data
143
- end
144
-
145
- # Get the angle of the page / document / receipt
146
- # Analyzes a photo or image of a document and identifies the rotation angle of the page.
147
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
148
- # @param [Hash] opts the optional parameters
149
- # @return [Array<(GetPageAngleResult, Fixnum, Hash)>] GetPageAngleResult data, response status code and response headers
150
- def preprocessing_get_page_angle_with_http_info(image_file, opts = {})
151
- if @api_client.config.debugging
152
- @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_get_page_angle ..."
153
- end
154
- # verify the required parameter 'image_file' is set
155
- if @api_client.config.client_side_validation && image_file.nil?
156
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PreprocessingApi.preprocessing_get_page_angle"
157
- end
158
- # resource path
159
- local_var_path = "/ocr/preprocessing/image/get-page-angle"
160
-
161
- # query parameters
162
- query_params = {}
163
-
164
- # header parameters
165
- header_params = {}
166
- # HTTP header 'Accept' (if needed)
167
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
168
- # HTTP header 'Content-Type'
169
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
170
-
171
- # form parameters
172
- form_params = {}
173
- form_params["imageFile"] = image_file
174
-
175
- # http body (model)
176
- post_body = nil
177
- auth_names = ['Apikey']
178
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
179
- :header_params => header_params,
180
- :query_params => query_params,
181
- :form_params => form_params,
182
- :body => post_body,
183
- :auth_names => auth_names,
184
- :return_type => 'GetPageAngleResult')
185
- if @api_client.config.debugging
186
- @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_get_page_angle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
187
- end
188
- return data, status_code, headers
189
- end
190
-
191
- # Detect and unrotate a document image
192
- # Detect and unrotate an image of a document (e.g. that was scanned at an angle). Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
193
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
194
- # @param [Hash] opts the optional parameters
195
- # @return [String]
196
- def preprocessing_unrotate(image_file, opts = {})
197
- data, _status_code, _headers = preprocessing_unrotate_with_http_info(image_file, opts)
198
- return data
199
- end
200
-
201
- # Detect and unrotate a document image
202
- # Detect and unrotate an image of a document (e.g. that was scanned at an angle). Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
203
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
204
- # @param [Hash] opts the optional parameters
205
- # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
206
- def preprocessing_unrotate_with_http_info(image_file, opts = {})
207
- if @api_client.config.debugging
208
- @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_unrotate ..."
209
- end
210
- # verify the required parameter 'image_file' is set
211
- if @api_client.config.client_side_validation && image_file.nil?
212
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PreprocessingApi.preprocessing_unrotate"
213
- end
214
- # resource path
215
- local_var_path = "/ocr/preprocessing/image/unrotate"
216
-
217
- # query parameters
218
- query_params = {}
219
-
220
- # header parameters
221
- header_params = {}
222
- # HTTP header 'Accept' (if needed)
223
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
224
- # HTTP header 'Content-Type'
225
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
226
-
227
- # form parameters
228
- form_params = {}
229
- form_params["imageFile"] = image_file
230
-
231
- # http body (model)
232
- post_body = nil
233
- auth_names = ['Apikey']
234
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
235
- :header_params => header_params,
236
- :query_params => query_params,
237
- :form_params => form_params,
238
- :body => post_body,
239
- :auth_names => auth_names,
240
- :return_type => 'String')
241
- if @api_client.config.debugging
242
- @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_unrotate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
- end
244
- return data, status_code, headers
245
- end
246
-
247
- # Detect and unrotate a document image (advanced)
248
- # Detect and unrotate an image of a document (e.g. that was scanned at an angle) using deep learning. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
249
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
250
- # @param [Hash] opts the optional parameters
251
- # @return [String]
252
- def preprocessing_unrotate_advanced(image_file, opts = {})
253
- data, _status_code, _headers = preprocessing_unrotate_advanced_with_http_info(image_file, opts)
254
- return data
255
- end
256
-
257
- # Detect and unrotate a document image (advanced)
258
- # Detect and unrotate an image of a document (e.g. that was scanned at an angle) using deep learning. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
259
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
260
- # @param [Hash] opts the optional parameters
261
- # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
262
- def preprocessing_unrotate_advanced_with_http_info(image_file, opts = {})
263
- if @api_client.config.debugging
264
- @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_unrotate_advanced ..."
265
- end
266
- # verify the required parameter 'image_file' is set
267
- if @api_client.config.client_side_validation && image_file.nil?
268
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PreprocessingApi.preprocessing_unrotate_advanced"
269
- end
270
- # resource path
271
- local_var_path = "/ocr/preprocessing/image/unrotate/advanced"
272
-
273
- # query parameters
274
- query_params = {}
275
-
276
- # header parameters
277
- header_params = {}
278
- # HTTP header 'Accept' (if needed)
279
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
280
- # HTTP header 'Content-Type'
281
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
282
-
283
- # form parameters
284
- form_params = {}
285
- form_params["imageFile"] = image_file
286
-
287
- # http body (model)
288
- post_body = nil
289
- auth_names = ['Apikey']
290
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
291
- :header_params => header_params,
292
- :query_params => query_params,
293
- :form_params => form_params,
294
- :body => post_body,
295
- :auth_names => auth_names,
296
- :return_type => 'String')
297
- if @api_client.config.debugging
298
- @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_unrotate_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
299
- end
300
- return data, status_code, headers
301
- end
302
-
303
- # Detect and unskew a photo of a document
304
- # Detect and unskew a photo of a document (e.g. taken on a cell phone) into a perfectly square image. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
305
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
306
- # @param [Hash] opts the optional parameters
307
- # @return [String]
308
- def preprocessing_unskew(image_file, opts = {})
309
- data, _status_code, _headers = preprocessing_unskew_with_http_info(image_file, opts)
310
- return data
311
- end
312
-
313
- # Detect and unskew a photo of a document
314
- # Detect and unskew a photo of a document (e.g. taken on a cell phone) into a perfectly square image. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
315
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
316
- # @param [Hash] opts the optional parameters
317
- # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
318
- def preprocessing_unskew_with_http_info(image_file, opts = {})
319
- if @api_client.config.debugging
320
- @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_unskew ..."
321
- end
322
- # verify the required parameter 'image_file' is set
323
- if @api_client.config.client_side_validation && image_file.nil?
324
- fail ArgumentError, "Missing the required parameter 'image_file' when calling PreprocessingApi.preprocessing_unskew"
325
- end
326
- # resource path
327
- local_var_path = "/ocr/preprocessing/image/unskew"
328
-
329
- # query parameters
330
- query_params = {}
331
-
332
- # header parameters
333
- header_params = {}
334
- # HTTP header 'Accept' (if needed)
335
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
336
- # HTTP header 'Content-Type'
337
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
338
-
339
- # form parameters
340
- form_params = {}
341
- form_params["imageFile"] = image_file
342
-
343
- # http body (model)
344
- post_body = nil
345
- auth_names = ['Apikey']
346
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
347
- :header_params => header_params,
348
- :query_params => query_params,
349
- :form_params => form_params,
350
- :body => post_body,
351
- :auth_names => auth_names,
352
- :return_type => 'String')
353
- if @api_client.config.debugging
354
- @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_unskew\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
355
- end
356
- return data, status_code, headers
357
- end
358
- end
359
- end