Class: CloudmersiveOcrApiClient::PdfOcrApi
- Inherits:
-
Object
- Object
- CloudmersiveOcrApiClient::PdfOcrApi
- Defined in:
- lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ PdfOcrApi
constructor
A new instance of PdfOcrApi.
-
#pdf_ocr_pdf_to_lines_with_location(image_file, opts = {}) ⇒ PdfToLinesWithLocationResult
Convert a PDF into text lines with location Converts a PDF into lines/text with location information and other metdata via Optical Character Recognition.
-
#pdf_ocr_pdf_to_lines_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(PdfToLinesWithLocationResult, Fixnum, Hash)>
Convert a PDF into text lines with location Converts a PDF into lines/text with location information and other metdata via Optical Character Recognition.
-
#pdf_ocr_pdf_to_words_with_location(image_file, opts = {}) ⇒ PdfToWordsWithLocationResult
Convert a PDF into words with location Converts a PDF into words/text with location information and other metdata via Optical Character Recognition.
-
#pdf_ocr_pdf_to_words_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(PdfToWordsWithLocationResult, Fixnum, Hash)>
Convert a PDF into words with location Converts a PDF into words/text with location information and other metdata via Optical Character Recognition.
-
#pdf_ocr_post(image_file, opts = {}) ⇒ PdfToTextResponse
Converts an uploaded PDF file into text via Optical Character Recognition.
-
#pdf_ocr_post_with_http_info(image_file, opts = {}) ⇒ Array<(PdfToTextResponse, Fixnum, Hash)>
Converts an uploaded PDF file into text via Optical Character Recognition.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#pdf_ocr_pdf_to_lines_with_location(image_file, opts = {}) ⇒ PdfToLinesWithLocationResult
Convert a PDF into text lines with location 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.
30 31 32 33 |
# File 'lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb', line 30 def pdf_ocr_pdf_to_lines_with_location(image_file, opts = {}) data, _status_code, _headers = pdf_ocr_pdf_to_lines_with_location_with_http_info(image_file, opts) return data end |
#pdf_ocr_pdf_to_lines_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(PdfToLinesWithLocationResult, Fixnum, Hash)>
Convert a PDF into text lines with location 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.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb', line 42 def pdf_ocr_pdf_to_lines_with_location_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: PdfOcrApi.pdf_ocr_pdf_to_lines_with_location ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling PdfOcrApi.pdf_ocr_pdf_to_lines_with_location" end # resource path local_var_path = "/ocr/pdf/to/lines-with-location" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PdfToLinesWithLocationResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PdfOcrApi#pdf_ocr_pdf_to_lines_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#pdf_ocr_pdf_to_words_with_location(image_file, opts = {}) ⇒ PdfToWordsWithLocationResult
Convert a PDF into words with location 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.
92 93 94 95 |
# File 'lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb', line 92 def pdf_ocr_pdf_to_words_with_location(image_file, opts = {}) data, _status_code, _headers = pdf_ocr_pdf_to_words_with_location_with_http_info(image_file, opts) return data end |
#pdf_ocr_pdf_to_words_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(PdfToWordsWithLocationResult, Fixnum, Hash)>
Convert a PDF into words with location 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.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb', line 104 def pdf_ocr_pdf_to_words_with_location_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: PdfOcrApi.pdf_ocr_pdf_to_words_with_location ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling PdfOcrApi.pdf_ocr_pdf_to_words_with_location" end # resource path local_var_path = "/ocr/pdf/to/words-with-location" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PdfToWordsWithLocationResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PdfOcrApi#pdf_ocr_pdf_to_words_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#pdf_ocr_post(image_file, opts = {}) ⇒ PdfToTextResponse
Converts an uploaded PDF file into text via Optical Character Recognition.
155 156 157 158 |
# File 'lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb', line 155 def pdf_ocr_post(image_file, opts = {}) data, _status_code, _headers = pdf_ocr_post_with_http_info(image_file, opts) return data end |
#pdf_ocr_post_with_http_info(image_file, opts = {}) ⇒ Array<(PdfToTextResponse, Fixnum, Hash)>
Converts an uploaded PDF file into text via Optical Character Recognition.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb', line 168 def pdf_ocr_post_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: PdfOcrApi.pdf_ocr_post ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling PdfOcrApi.pdf_ocr_post" end # resource path local_var_path = "/ocr/pdf/toText" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil? header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PdfToTextResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: PdfOcrApi#pdf_ocr_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |