aspose_html 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +92 -0
- data/LICENSE +21 -0
- data/README.md +181 -0
- data/Rakefile +8 -0
- data/aspose_html.gemspec +58 -0
- data/docs/ConversionApi.md +837 -0
- data/docs/DocumentApi.md +386 -0
- data/docs/OcrApi.md +128 -0
- data/docs/SummarizationApi.md +111 -0
- data/docs/TranslationApi.md +126 -0
- data/docs/storage/DiscUsage.md +9 -0
- data/docs/storage/DiscUsageResponse.md +10 -0
- data/docs/storage/FileApi.md +240 -0
- data/docs/storage/FileDetail.md +13 -0
- data/docs/storage/FileDetailsResponse.md +10 -0
- data/docs/storage/FileExist.md +9 -0
- data/docs/storage/FileExistResponse.md +10 -0
- data/docs/storage/FileVersion.md +15 -0
- data/docs/storage/FileVersionsResponse.md +10 -0
- data/docs/storage/FolderApi.md +229 -0
- data/docs/storage/MessageResponse.md +9 -0
- data/docs/storage/MoveFileResponse.md +9 -0
- data/docs/storage/MoveFolderResponse.md +9 -0
- data/docs/storage/RemoveFileResponse.md +9 -0
- data/docs/storage/RemoveFolderResponse.md +9 -0
- data/docs/storage/StorageApi.md +217 -0
- data/docs/storage/StorageExistResponse.md +10 -0
- data/lib/aspose_html.rb +68 -0
- data/lib/aspose_html/api/html_api.rb +1900 -0
- data/lib/aspose_html/api/storage_api.rb +774 -0
- data/lib/aspose_html/api_client.rb +386 -0
- data/lib/aspose_html/api_error.rb +54 -0
- data/lib/aspose_html/configuration.rb +175 -0
- data/lib/aspose_html/models/disc_usage.rb +223 -0
- data/lib/aspose_html/models/disc_usage_response.rb +260 -0
- data/lib/aspose_html/models/file_detail.rb +254 -0
- data/lib/aspose_html/models/file_details_response.rb +262 -0
- data/lib/aspose_html/models/file_exist.rb +223 -0
- data/lib/aspose_html/models/file_exist_response.rb +274 -0
- data/lib/aspose_html/models/file_version.rb +273 -0
- data/lib/aspose_html/models/file_versions_response.rb +262 -0
- data/lib/aspose_html/models/message_response.rb +251 -0
- data/lib/aspose_html/models/move_file_response.rb +251 -0
- data/lib/aspose_html/models/move_folder_response.rb +251 -0
- data/lib/aspose_html/models/remove_file_response.rb +251 -0
- data/lib/aspose_html/models/remove_folder_response.rb +251 -0
- data/lib/aspose_html/models/storage_exist_response.rb +260 -0
- data/lib/aspose_html/version.rb +31 -0
- data/spec/api/html_api_spec.rb +971 -0
- data/spec/api/model_spec.rb +622 -0
- data/spec/api/storage_api_spec.rb +596 -0
- data/spec/spec_helper.rb +169 -0
- data/testdata/test.txt +1 -0
- data/testdata/test1.html +19 -0
- data/testdata/test1.html.zip +0 -0
- data/testdata/test2.html +46 -0
- data/testdata/test2.html.zip +0 -0
- data/testdata/test3.html.zip +0 -0
- data/testdata/test4.html.zip +0 -0
- data/testdata/test_download.jpg +0 -0
- data/testdata/test_en.html +46 -0
- data/testdata/test_for_delete.html +46 -0
- data/testdata/test_for_move.html +46 -0
- data/testdata/test_get_doc.zip +0 -0
- data/testdata/test_ocr.jpg +0 -0
- data/testdata/test_ocr.png +0 -0
- data/testdata/test_put_create.html +19 -0
- data/testdata/test_put_create.jpg +0 -0
- data/testresult/Convert_html.bmp +0 -0
- data/testresult/Convert_html.pdf +0 -0
- data/testresult/Convert_html.xps +0 -0
- data/testresult/Convert_url.pdf +0 -0
- data/testresult/Convert_url.png +0 -0
- data/testresult/Convert_url.xps +0 -0
- data/testresult/Get_document.zip +0 -0
- data/testresult/Get_fragment_css_by_url.html +447 -0
- data/testresult/Get_fragment_doc.html +9 -0
- data/testresult/Get_fragment_doc_css.html +9 -0
- data/testresult/Get_fragment_xpath_by_url.html +38 -0
- data/testresult/Get_images_doc.zip +0 -0
- data/testresult/Get_images_from_url.zip +0 -0
- data/testresult/Keyword_by_doc.json +1 -0
- data/testresult/Keyword_by_url.json +1 -0
- data/testresult/Recognize_en_png.html +10 -0
- data/testresult/Translate_url_en_fr.zip +0 -0
- data/testresult/putTest.pdf +0 -0
- data/testresult/putTest.png +0 -0
- data/testresult/putTest.xps +0 -0
- data/testresult/putTestDoc.pdf +0 -0
- data/testresult/putTestDoc.tiff +0 -0
- data/testresult/putTestDoc.xps +0 -0
- data/testresult/test_download.jpg +0 -0
- metadata +320 -0
data/docs/DocumentApi.md
ADDED
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
# Document API
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.aspose.cloud/v1.1*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**get_document**](DocumentApi.md#get_document) | **GET** /html/{name} | Return the HTML document by the name from default or specified storage.
|
|
8
|
+
[**get_document_fragment_by_x_path**](DocumentApi.md#get_document_fragment_by_x_path) | **GET** /html/{name}/fragments/{outFormat} | Return list of HTML fragments matching the specified XPath query.
|
|
9
|
+
[**get_document_fragment_by_x_path_by_url**](DocumentApi.md#get_document_fragment_by_x_path_by_url) | **GET** /html/fragments/{outFormat} | Return list of HTML fragments matching the specified XPath query by the source page URL.
|
|
10
|
+
[**get_document_fragments_by_css_selector**](DocumentApi.md#get_document_fragments_by_css_selector) | **GET** /html/{name}/fragments/css/{outFormat} | Return list of HTML fragments matching the specified CSS selector.
|
|
11
|
+
[**get_document_fragments_by_css_selector_by_url**](DocumentApi.md#get_document_fragments_by_css_selector_by_url) | **GET** /html/fragments/css/{outFormat} | Return list of HTML fragments matching the specified CSS selector by the source page URL.
|
|
12
|
+
[**get_document_images**](DocumentApi.md#get_document_images) | **GET** /html/{name}/images/all | Return all HTML document images packaged as a ZIP archive.
|
|
13
|
+
[**get_document_images_by_url**](DocumentApi.md#get_document_images_by_url) | **GET** /html/images/all | Return all HTML page images packaged as a ZIP archive by the source page URL.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# **get_document**
|
|
17
|
+
> Hash get_document(name, opts)
|
|
18
|
+
|
|
19
|
+
Return the HTML document by the name from default or specified storage.
|
|
20
|
+
|
|
21
|
+
### Example
|
|
22
|
+
```ruby
|
|
23
|
+
# load the gem
|
|
24
|
+
require 'aspose_html'
|
|
25
|
+
|
|
26
|
+
CONFIG = {
|
|
27
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
28
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
29
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
30
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
31
|
+
"debug":true
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
35
|
+
|
|
36
|
+
name = "test.html" # String | The document name.
|
|
37
|
+
|
|
38
|
+
opts = {
|
|
39
|
+
storage: "storage_example", # String | The document folder
|
|
40
|
+
folder: "folder_example" # String | The document folder.
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
begin
|
|
44
|
+
#Return the HTML document by the name from default or specified storage.
|
|
45
|
+
result = api_instance.get_document(name, opts)
|
|
46
|
+
p result
|
|
47
|
+
rescue AsposeHtml::ApiError => e
|
|
48
|
+
puts "Exception when calling HtmlApi->get_document: #{e}"
|
|
49
|
+
end
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Parameters
|
|
53
|
+
|
|
54
|
+
Name | Type | Description | Notes
|
|
55
|
+
------------- | ------------- | ------------- | -------------
|
|
56
|
+
**name** | **String**| The document name. |
|
|
57
|
+
**storage** | **String**| The document folder | [optional]
|
|
58
|
+
**folder** | **String**| The document folder. | [optional]
|
|
59
|
+
|
|
60
|
+
### Return type
|
|
61
|
+
|
|
62
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
63
|
+
|
|
64
|
+
### HTTP request headers
|
|
65
|
+
|
|
66
|
+
- **Content-Type**: application/json
|
|
67
|
+
- **Accept**: multipart/form-data, application/zip
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# **get_document_fragment_by_x_path**
|
|
71
|
+
> Hash get_document_fragment_by_x_path(name, x_path, out_format, opts)
|
|
72
|
+
|
|
73
|
+
Return list of HTML fragments matching the specified XPath query.
|
|
74
|
+
|
|
75
|
+
### Example
|
|
76
|
+
```ruby
|
|
77
|
+
# load the gem
|
|
78
|
+
require 'aspose_html'
|
|
79
|
+
|
|
80
|
+
CONFIG = {
|
|
81
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
82
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
83
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
84
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
85
|
+
"debug":true
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
89
|
+
|
|
90
|
+
name = "test2.html.zip" # String | The document name.
|
|
91
|
+
|
|
92
|
+
x_path = ".//p" # String | XPath query string.
|
|
93
|
+
|
|
94
|
+
out_format = "plain" # String | Output format. Possible values: 'plain' and 'json'.
|
|
95
|
+
|
|
96
|
+
opts = {
|
|
97
|
+
storage: "storage_example", # String | The document storage.
|
|
98
|
+
folder: "folder_example" # String | The document folder.
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
begin
|
|
102
|
+
#Return list of HTML fragments matching the specified XPath query.
|
|
103
|
+
result = api_instance.get_document_fragment_by_x_path(name, x_path, out_format, opts)
|
|
104
|
+
p result
|
|
105
|
+
rescue AsposeHtml::ApiError => e
|
|
106
|
+
puts "Exception when calling HtmlApi->get_document_fragment_by_x_path: #{e}"
|
|
107
|
+
end
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Parameters
|
|
111
|
+
|
|
112
|
+
Name | Type | Description | Notes
|
|
113
|
+
------------- | ------------- | ------------- | -------------
|
|
114
|
+
**name** | **String**| The document name. |
|
|
115
|
+
**x_path** | **String**| XPath query string. |
|
|
116
|
+
**out_format** | **String**| Output format. Possible values: 'plain' and 'json'. |
|
|
117
|
+
**storage** | **String**| The document storage. | [optional]
|
|
118
|
+
**folder** | **String**| The document folder. | [optional]
|
|
119
|
+
|
|
120
|
+
### Return type
|
|
121
|
+
|
|
122
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
123
|
+
|
|
124
|
+
### HTTP request headers
|
|
125
|
+
|
|
126
|
+
- **Content-Type**: application/json
|
|
127
|
+
- **Accept**: multipart/form-data
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# **get_document_fragment_by_x_path_by_url**
|
|
131
|
+
> Hash get_document_fragment_by_x_path_by_url(source_url, x_path, out_format)
|
|
132
|
+
|
|
133
|
+
Return list of HTML fragments matching the specified XPath query by the source page URL.
|
|
134
|
+
|
|
135
|
+
### Example
|
|
136
|
+
```ruby
|
|
137
|
+
# load the gem
|
|
138
|
+
require 'aspose_html'
|
|
139
|
+
|
|
140
|
+
CONFIG = {
|
|
141
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
142
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
143
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
144
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
145
|
+
"debug":true
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
149
|
+
|
|
150
|
+
source_url = "https://stallman.org/articles/anonymous-payments-thru-phones.html"
|
|
151
|
+
x_path = ".//p"
|
|
152
|
+
out_format = "plain"
|
|
153
|
+
|
|
154
|
+
begin
|
|
155
|
+
#Return list of HTML fragments matching the specified XPath query.
|
|
156
|
+
result = api_instance.get_document_fragment_by_x_path_by_url(source_url, x_path, out_format)
|
|
157
|
+
p result
|
|
158
|
+
rescue AsposeHtml::ApiError => e
|
|
159
|
+
puts "Exception when calling HtmlApi->get_document_fragment_by_x_path_by_url: #{e}"
|
|
160
|
+
end
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Parameters
|
|
164
|
+
|
|
165
|
+
Name | Type | Description | Notes
|
|
166
|
+
------------- | ------------- | ------------- | -------------
|
|
167
|
+
**source_url** | **String**| Source page URL. |
|
|
168
|
+
**x_path** | **String**| XPath query string. |
|
|
169
|
+
**out_format** | **String**| Output format. Possible values: 'plain' and 'json'. |
|
|
170
|
+
|
|
171
|
+
### Return type
|
|
172
|
+
|
|
173
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
174
|
+
|
|
175
|
+
### HTTP request headers
|
|
176
|
+
|
|
177
|
+
- **Content-Type**: application/json
|
|
178
|
+
- **Accept**: application/zip
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
# **get_document_fragments_by_css_selector**
|
|
182
|
+
> Hash document_get_document_fragments_by_css_selector(name, selector, out_format, opts)
|
|
183
|
+
|
|
184
|
+
Return list of HTML fragments matching the specified CSS selector.
|
|
185
|
+
|
|
186
|
+
### Example
|
|
187
|
+
```ruby
|
|
188
|
+
# load the gem
|
|
189
|
+
require 'aspose_html'
|
|
190
|
+
|
|
191
|
+
CONFIG = {
|
|
192
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
193
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
194
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
195
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
196
|
+
"debug":true
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
200
|
+
|
|
201
|
+
name = "test2.html.zip"
|
|
202
|
+
selector = "div p"
|
|
203
|
+
out_format = "plain"
|
|
204
|
+
opts = {folder: "HtmlTestDoc", storage: nil}
|
|
205
|
+
|
|
206
|
+
begin
|
|
207
|
+
#Return list of HTML fragments matching the specified CSS selector.
|
|
208
|
+
result = api_instance.document_get_document_fragments_by_css_selector(name, selector, out_format, opts)
|
|
209
|
+
p result
|
|
210
|
+
rescue AsposeHtml::ApiError => e
|
|
211
|
+
puts "Exception when calling HtmlApi->document_get_document_fragments_by_css_selector: #{e}"
|
|
212
|
+
end
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Parameters
|
|
216
|
+
|
|
217
|
+
Name | Type | Description | Notes
|
|
218
|
+
------------- | ------------- | ------------- | -------------
|
|
219
|
+
**name** | **String**| The document name. |
|
|
220
|
+
**selector** | **String**| CSS selector string. |
|
|
221
|
+
**out_format** | **String**| Output format. Possible values: 'plain' and 'json'. |
|
|
222
|
+
**folder** | **String**| The document folder. | [optional]
|
|
223
|
+
**storage** | **String**| The document storage. | [optional]
|
|
224
|
+
|
|
225
|
+
### Return type
|
|
226
|
+
|
|
227
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
228
|
+
|
|
229
|
+
### HTTP request headers
|
|
230
|
+
|
|
231
|
+
- **Content-Type**: application/json
|
|
232
|
+
- **Accept**: multipart/form-data
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
# **get_document_fragments_by_css_selector_by_url**
|
|
236
|
+
> Hash document_get_document_fragments_by_css_selector_by_url(source_url, selector, out_format)
|
|
237
|
+
|
|
238
|
+
Return list of HTML fragments matching the specified CSS selector by the source page URL.
|
|
239
|
+
|
|
240
|
+
### Example
|
|
241
|
+
```ruby
|
|
242
|
+
# load the gem
|
|
243
|
+
require 'aspose_html'
|
|
244
|
+
|
|
245
|
+
CONFIG = {
|
|
246
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
247
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
248
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
249
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
250
|
+
"debug":true
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
254
|
+
|
|
255
|
+
source_url = "source_url_example" # String | Source page URL.
|
|
256
|
+
|
|
257
|
+
selector = "selector_example" # String | CSS selector string.
|
|
258
|
+
|
|
259
|
+
out_format = "out_format_example" # String | Output format. Possible values: 'plain' and 'json'.
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
begin
|
|
263
|
+
#Return list of HTML fragments matching the specified CSS selector by the source page URL.
|
|
264
|
+
result = api_instance.document_get_document_fragments_by_css_selector_by_url(source_url, selector, out_format)
|
|
265
|
+
p result
|
|
266
|
+
rescue AsposeHtml::ApiError => e
|
|
267
|
+
puts "Exception when calling HtmlApi->document_get_document_fragments_by_css_selector_by_url: #{e}"
|
|
268
|
+
end
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Parameters
|
|
272
|
+
|
|
273
|
+
Name | Type | Description | Notes
|
|
274
|
+
------------- | ------------- | ------------- | -------------
|
|
275
|
+
**source_url** | **String**| Source page URL. |
|
|
276
|
+
**selector** | **String**| CSS selector string. |
|
|
277
|
+
**out_format** | **String**| Output format. Possible values: 'plain' and 'json'. |
|
|
278
|
+
|
|
279
|
+
### Return type
|
|
280
|
+
|
|
281
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
282
|
+
|
|
283
|
+
### HTTP request headers
|
|
284
|
+
|
|
285
|
+
- **Content-Type**: application/json
|
|
286
|
+
- **Accept**: multipart/form-data
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
# **get_document_images**
|
|
290
|
+
> Hash get_document_images(name, opts)
|
|
291
|
+
|
|
292
|
+
Return all HTML document images packaged as a ZIP archive.
|
|
293
|
+
|
|
294
|
+
### Example
|
|
295
|
+
```ruby
|
|
296
|
+
# load the gem
|
|
297
|
+
require 'aspose_html'
|
|
298
|
+
|
|
299
|
+
CONFIG = {
|
|
300
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
301
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
302
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
303
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
304
|
+
"debug":true
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
308
|
+
|
|
309
|
+
name = "test3.html.zip" # String | The document name.
|
|
310
|
+
|
|
311
|
+
opts = {
|
|
312
|
+
folder: "folder_example", # String | The document folder.
|
|
313
|
+
storage: "storage_example" # String | The document storage.
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
begin
|
|
317
|
+
#Return all HTML document images packaged as a ZIP archive.
|
|
318
|
+
result = api_instance.get_document_images(name, opts)
|
|
319
|
+
p result
|
|
320
|
+
rescue AsposeHtml::ApiError => e
|
|
321
|
+
puts "Exception when calling HtmlApi->get_document_images: #{e}"
|
|
322
|
+
end
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Parameters
|
|
326
|
+
|
|
327
|
+
Name | Type | Description | Notes
|
|
328
|
+
------------- | ------------- | ------------- | -------------
|
|
329
|
+
**name** | **String**| The document name. |
|
|
330
|
+
**folder** | **String**| The document folder. | [optional]
|
|
331
|
+
**storage** | **String**| The document storage. | [optional]
|
|
332
|
+
|
|
333
|
+
### Return type
|
|
334
|
+
|
|
335
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
336
|
+
|
|
337
|
+
### HTTP request headers
|
|
338
|
+
|
|
339
|
+
- **Content-Type**: application/json
|
|
340
|
+
- **Accept**: application/zip
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
# **get_document_images_by_url**
|
|
344
|
+
> Hash get_document_images_by_url(source_url)
|
|
345
|
+
|
|
346
|
+
Return all HTML page images packaged as a ZIP archive by the source page URL.
|
|
347
|
+
|
|
348
|
+
### Example
|
|
349
|
+
```ruby
|
|
350
|
+
# load the gem
|
|
351
|
+
require 'aspose_html'
|
|
352
|
+
|
|
353
|
+
CONFIG = {
|
|
354
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
355
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
356
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
357
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
358
|
+
"debug":true
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
begin
|
|
365
|
+
#Return all HTML document images packaged as a ZIP archive.
|
|
366
|
+
result = api_instance.get_document_images_by_url(source_url)
|
|
367
|
+
p result
|
|
368
|
+
rescue AsposeHtml::ApiError => e
|
|
369
|
+
puts "Exception when calling HtmlApi->get_document_images_by_url: #{e}"
|
|
370
|
+
end
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Parameters
|
|
374
|
+
|
|
375
|
+
Name | Type | Description | Notes
|
|
376
|
+
------------- | ------------- | ------------- | -------------
|
|
377
|
+
**source_url** | **String**| Source page URL. |
|
|
378
|
+
|
|
379
|
+
### Return type
|
|
380
|
+
|
|
381
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
382
|
+
|
|
383
|
+
### HTTP request headers
|
|
384
|
+
|
|
385
|
+
- **Content-Type**: application/json
|
|
386
|
+
- **Accept**: application/zip
|
data/docs/OcrApi.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# OCR API
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.aspose.cloud/v1.1*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**get_recognize_and_import_to_html**](OcrApi.md#get_recognize_and_import_to_html) | **GET** /html/{name}/ocr/import | Recognize text from the image file in the storage and import it to HTML format.
|
|
8
|
+
[**get_recognize_and_translate_to_html**](OcrApi.md#get_recognize_and_translate_to_html) | **GET** /html/{name}/ocr/translate/{srcLang}/{resLang} | Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# **get_recognize_and_import_to_html**
|
|
12
|
+
> Hash get_recognize_and_import_to_html(name, opts)
|
|
13
|
+
|
|
14
|
+
Recognize text from the image file in the storage and import it to HTML format.
|
|
15
|
+
|
|
16
|
+
### Example
|
|
17
|
+
```ruby
|
|
18
|
+
# load the gem
|
|
19
|
+
require 'aspose_html'
|
|
20
|
+
|
|
21
|
+
CONFIG = {
|
|
22
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
23
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
24
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
25
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
26
|
+
"debug":true
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
30
|
+
|
|
31
|
+
name = "test_ocr.png" # String | The image file name.
|
|
32
|
+
|
|
33
|
+
opts = {
|
|
34
|
+
ocr_engine_lang: "en", # String | OCR engine language - language
|
|
35
|
+
folder: "folder_example", # String | The source image folder.
|
|
36
|
+
storage: "storage_example" # String | The source image storage.
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
begin
|
|
40
|
+
#Recognize text from the image file in the storage and import it to HTML format.
|
|
41
|
+
result = api_instance.get_recognize_and_import_to_html(name, opts)
|
|
42
|
+
p result
|
|
43
|
+
rescue AsposeHtml::ApiError => e
|
|
44
|
+
puts "Exception when calling HtmlApi->get_recognize_and_import_to_html: #{e}"
|
|
45
|
+
end
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Parameters
|
|
49
|
+
|
|
50
|
+
Name | Type | Description | Notes
|
|
51
|
+
------------- | ------------- | ------------- | -------------
|
|
52
|
+
**name** | **String**| The image file name. |
|
|
53
|
+
**ocr_engine_lang** | **String**| OCR engine language - language | [optional] [default to en]
|
|
54
|
+
**folder** | **String**| The source image folder. | [optional]
|
|
55
|
+
**storage** | **String**| The source image storage. | [optional]
|
|
56
|
+
|
|
57
|
+
### Return type
|
|
58
|
+
|
|
59
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
60
|
+
|
|
61
|
+
### HTTP request headers
|
|
62
|
+
|
|
63
|
+
- **Content-Type**: application/json
|
|
64
|
+
- **Accept**: multipart/form-data
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# **get_recognize_and_translate_to_html**
|
|
69
|
+
> Hash get_recognize_and_translate_to_html(name, src_lang, res_lang, opts)
|
|
70
|
+
|
|
71
|
+
Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
|
|
72
|
+
|
|
73
|
+
### Example
|
|
74
|
+
```ruby
|
|
75
|
+
# load the gem
|
|
76
|
+
require 'aspose_html'
|
|
77
|
+
|
|
78
|
+
CONFIG = {
|
|
79
|
+
"basePath":"https://api.aspose.cloud/v1.1",
|
|
80
|
+
"authPath":"https://api.aspose.cloud/oauth2/token",
|
|
81
|
+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
82
|
+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
83
|
+
"debug":true
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
api_instance = AsposeHtml::HtmlApi.new CONFIG
|
|
87
|
+
|
|
88
|
+
name = "test_ocr.jpg" # String | The image file name.
|
|
89
|
+
|
|
90
|
+
src_lang = "en" # String | Source language - also supposed as the OCR engine language.
|
|
91
|
+
|
|
92
|
+
res_lang = "de" # String | Result language.
|
|
93
|
+
|
|
94
|
+
opts = {
|
|
95
|
+
folder: "folder_example", # String | The source image folder.
|
|
96
|
+
storage: "storage_example" # String | The source image storage.
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
begin
|
|
100
|
+
#Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
|
|
101
|
+
result = api_instance.get_recognize_and_translate_to_html(name, src_lang, res_lang, opts)
|
|
102
|
+
p result
|
|
103
|
+
rescue AsposeHtml::ApiError => e
|
|
104
|
+
puts "Exception when calling HtmlApi->get_recognize_and_translate_to_html: #{e}"
|
|
105
|
+
end
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Parameters
|
|
109
|
+
|
|
110
|
+
Name | Type | Description | Notes
|
|
111
|
+
------------- | ------------- | ------------- | -------------
|
|
112
|
+
**name** | **String**| The image file name. |
|
|
113
|
+
**src_lang** | **String**| Source language - also supposed as the OCR engine language. |
|
|
114
|
+
**res_lang** | **String**| Result language. |
|
|
115
|
+
**folder** | **String**| The source image folder. | [optional]
|
|
116
|
+
**storage** | **String**| The source image storage. | [optional]
|
|
117
|
+
|
|
118
|
+
### Return type
|
|
119
|
+
|
|
120
|
+
**[Hash] {file: data, status: _status_code, headers: _headers}**
|
|
121
|
+
|
|
122
|
+
### HTTP request headers
|
|
123
|
+
|
|
124
|
+
- **Content-Type**: application/json
|
|
125
|
+
- **Accept**: multipart/form-data
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|