aspose_html_cloud 22.11.1 → 22.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d1b7ca4f575f576715bd56b470d6e326e18439c9f626e941f8242b9632e73e9
4
- data.tar.gz: e32204d5d61c8e07a66cfa3c6ed1bf7483948ea79af04210dc2b80023b696594
3
+ metadata.gz: a927f766c44d069be1fa647614ed0ba4df757135ba36df1ab5fd03f44ada11e2
4
+ data.tar.gz: 5ed40aeaedfb53018f57e6a4b8ebc70e299caddb5f7ebf98bb012f3aa2aaca5e
5
5
  SHA512:
6
- metadata.gz: 5f89551d802e98480870d680e176524482be01506aee6971d86236412e3cba069998b208d6ae31aff814e265f68ee293ba18c29c838e15302d7862f0fdc58709
7
- data.tar.gz: 3af762e1b9007b820d08ddadef2291cd506b8e30687fd086770954fa4cfd25f79a1feca89d7a4ebcff52c97dd0e7f7fb9da9c675582fb59ff6cdcd9801482ffd
6
+ metadata.gz: af3da353d85ddcad122665d921ce8ea46a5ab01f90062721d2794c7b61f1f503ae1ec4269d94a73ce4f08670f7f18d6d7a083eff92f9dcac04d90510fa6f8672
7
+ data.tar.gz: 05b35cfe4175def4f7e3de35dbbb7f85607b93ac3f227f0fed129aa0f09d404f5f94026d216e7e86c580a53e78dafc10514fcfa51a5b6808ccc946efeb016c6c
@@ -39,69 +39,69 @@ module AsposeHtml
39
39
  end
40
40
 
41
41
 
42
- # Converting the HTML, EPUB document from the local file and putting the result in the local file
42
+ # Converting a document from the local file and putting the result in the local file
43
43
  #
44
44
  # @param src Full path to source file.
45
- # @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
45
+ # @param dst Full path to a result file.
46
46
  # @param [Hash, nil] options the optional parameters
47
- # @option options [Double] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
48
- # @option options [Double] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
49
- # @option options [Double] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
50
- # @option options [Double] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
51
- # @option options [Double] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
52
- # @option options [Double] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
53
- # @return [ConversionResult] Result of conversion. See ConversionResult object.
47
+ # @option options [Float] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
48
+ # @option options [Float] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
49
+ # @option options [Float] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
50
+ # @option options [Float] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
51
+ # @option options [Float] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
52
+ # @option options [Float] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
53
+ # @return [OperationResult] Result of operation. See OperationResult object.
54
54
  def convert_local_to_local(src, dst, options = nil)
55
55
  convert(src, dst, true, true, false, options)
56
56
  end
57
57
 
58
- # Converting the HTML, EPUB document from the local file and putting the result in the storage
58
+ # Converting a document from the local file and putting the result in the storage
59
59
  #
60
60
  # @param src Full path to source file.
61
- # @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
61
+ # @param dst Full path to a result file.
62
62
  # @param storage Storage name. Default storage is nil.
63
63
  # @param [Hash, nil] options the optional parameters
64
- # @option options [Double] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
65
- # @option options [Double] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
66
- # @option options [Double] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
67
- # @option options [Double] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
68
- # @option options [Double] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
69
- # @option options [Double] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
70
- # @return [ConversionResult] Result of conversion. See ConversionResult object.
64
+ # @option options [Float] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
65
+ # @option options [Float] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
66
+ # @option options [Float] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
67
+ # @option options [Float] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
68
+ # @option options [Float] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
69
+ # @option options [Float] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
70
+ # @return [OperationResult] Result of operation. See OperationResult object.
71
71
  def convert_local_to_storage(src, dst, storage, options=nil)
72
72
  convert(src, dst, true, false, false, options, storage)
73
73
  end
74
74
 
75
- # Converting the HTML, EPUB document from the storage and putting the result in the local file
75
+ # Converting a document from the storage and putting the result in the local file
76
76
  #
77
77
  # @param src Full path to source file.
78
- # @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
78
+ # @param dst Full path to a result file.
79
79
  # @param storage Storage name. Default storage is nil.
80
80
  # @param [Hash, nil] options the optional parameters
81
- # @option options [Double] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
82
- # @option options [Double] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
83
- # @option options [Double] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
84
- # @option options [Double] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
85
- # @option options [Double] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
86
- # @option options [Double] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
87
- # @return [ConversionResult] Result of conversion. See ConversionResult object.
81
+ # @option options [Float] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
82
+ # @option options [Float] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
83
+ # @option options [Float] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
84
+ # @option options [Float] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
85
+ # @option options [Float] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
86
+ # @option options [Float] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
87
+ # @return [OperationResult] Result of operation. See OperationResult object.
88
88
  def convert_storage_to_local(src, dst, storage, options=nil)
89
89
  convert(src, dst, false, true, false, options, storage)
90
90
  end
91
91
 
92
- # Converting the HTML, EPUB document from the storage and putting the result in the storage
92
+ # Converting a document from the storage and putting the result in the storage
93
93
  #
94
94
  # @param src Full path to source file.
95
- # @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
95
+ # @param dst Full path to a result file.
96
96
  # @param storage Storage name. Default storage is nil.
97
97
  # @param [Hash, nil] options the optional parameters
98
- # @option options [Double] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
99
- # @option options [Double] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
100
- # @option options [Double] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
101
- # @option options [Double] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
102
- # @option options [Double] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
103
- # @option options [Double] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
104
- # @return [ConversionResult] Result of conversion. See ConversionResult object.
98
+ # @option options [Float] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
99
+ # @option options [Float] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
100
+ # @option options [Float] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
101
+ # @option options [Float] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
102
+ # @option options [Float] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
103
+ # @option options [Float] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
104
+ # @return [OperationResult] Result of operation. See OperationResult object.
105
105
  def convert_storage_to_storage(src, dst, storage, options=nil)
106
106
  convert(src, dst, false, false, false, options, storage)
107
107
  end
@@ -109,15 +109,15 @@ module AsposeHtml
109
109
  # Converting the HTML page from URL and putting the result in the local file
110
110
  #
111
111
  # @param src URI of the website.
112
- # @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
112
+ # @param dst Full path to a result file.
113
113
  # @param [Hash, nil] options the optional parameters
114
- # @option options [Double] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
115
- # @option options [Double] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
116
- # @option options [Double] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
117
- # @option options [Double] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
118
- # @option options [Double] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
119
- # @option options [Double] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
120
- # @return [ConversionResult] Result of conversion. See ConversionResult object.
114
+ # @option options [Float] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
115
+ # @option options [Float] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
116
+ # @option options [Float] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
117
+ # @option options [Float] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
118
+ # @option options [Float] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
119
+ # @option options [Float] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
120
+ # @return [OperationResult] Result of operation. See OperationResult object.
121
121
  def convert_url_to_local(src, dst, options=nil)
122
122
  convert(src, dst, false, true, true, options)
123
123
  end
@@ -125,36 +125,117 @@ module AsposeHtml
125
125
  # Converting the HTML page from URL and putting the result in the storage
126
126
  #
127
127
  # @param src URI of the website.
128
- # @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
128
+ # @param dst Full path to a result file.
129
129
  # @param storage Storage name. Default storage is nil.
130
130
  # @param [Hash, nil] options the optional parameters
131
- # @option options [Double] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
132
- # @option options [Double] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
133
- # @option options [Double] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
134
- # @option options [Double] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
135
- # @option options [Double] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
136
- # @option options [Double] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
137
- # @return [ConversionResult] Result of conversion. See ConversionResult object.
131
+ # @option options [Float] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
132
+ # @option options [Float] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
133
+ # @option options [Float] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
134
+ # @option options [Float] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
135
+ # @option options [Float] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
136
+ # @option options [Float] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
137
+ # @return [OperationResult] Result of operation. See OperationResult object.
138
138
  def convert_url_to_storage(src, dst, storage, options=nil)
139
139
  convert(src, dst, false, false, true, options, storage)
140
140
  end
141
141
 
142
- # Converting the HTML document to various formats
142
+ # Vectorization an image from the local file and putting the result in the local file
143
+ #
144
+ # @param src Full path to source file(bmp, png, gif, tiff, jpeg).
145
+ # @param dst Full path to a result file (svg).
146
+ # @param [Hash, nil] options the optional parameters
147
+ # @option options [Float] :error_threshold Defines maximum deviation of points to fitted curve. By default it is 30.
148
+ # @option options [Integer] :max_iterations Defines number of iteration for least-squares approximation method. By default, it is 30.
149
+ # @option options [Integer] :colors_limit The maximum number of colors used to quantize an image. Default value is 25.
150
+ # @option options [Float] :line_width The value of this parameter is affected by the graphics scale. Default value is 1.
151
+ # @return [OperationResult] Result of operation. See OperationResult object.
152
+ def vectorize_local_to_local(src, dst, options = nil)
153
+ vectorize(src, dst, true, true, options)
154
+ end
155
+
156
+ # Vectorization an image from the local file and putting the result in the storage
157
+ #
158
+ # @param src Full path to source file(bmp, png, gif, tiff, jpeg).
159
+ # @param dst Full path to a result file (svg).
160
+ # @param storage Storage name. Default storage is nil.
161
+ # @param [Hash, nil] options the optional parameters
162
+ # @option options [Float] :error_threshold Defines maximum deviation of points to fitted curve. By default it is 30.
163
+ # @option options [Integer] :max_iterations Defines number of iteration for least-squares approximation method. By default, it is 30.
164
+ # @option options [Integer] :colors_limit The maximum number of colors used to quantize an image. Default value is 25.
165
+ # @option options [Float] :line_width The value of this parameter is affected by the graphics scale. Default value is 1.
166
+ # @return [OperationResult] Result of operation. See OperationResult object.
167
+ def vectorize_local_to_storage(src, dst, storage, options=nil)
168
+ vectorize(src, dst, true, false, options, storage)
169
+ end
170
+
171
+ # Vectorization an image from the storage and putting the result in the local file
172
+ #
173
+ # @param src Full path to source file(bmp, png, gif, tiff, jpeg).
174
+ # @param dst Full path to a result file (svg).
175
+ # @param storage Storage name. Default storage is nil.
176
+ # @param [Hash, nil] options the optional parameters
177
+ # @option options [Float] :error_threshold Defines maximum deviation of points to fitted curve. By default it is 30.
178
+ # @option options [Integer] :max_iterations Defines number of iteration for least-squares approximation method. By default, it is 30.
179
+ # @option options [Integer] :colors_limit The maximum number of colors used to quantize an image. Default value is 25.
180
+ # @option options [Float] :line_width The value of this parameter is affected by the graphics scale. Default value is 1.
181
+ # @return [OperationResult] Result of operation. See OperationResult object.
182
+ def vectorize_storage_to_local(src, dst, storage, options=nil)
183
+ vectorize(src, dst, false, true, options, storage)
184
+ end
185
+
186
+ # Vectorization an image from the storage and putting the result in the storage
187
+ #
188
+ # @param src Full path to source file(bmp, png, gif, tiff, jpeg).
189
+ # @param dst Full path to a result file (svg).
190
+ # @param storage Storage name. Default storage is nil.
191
+ # @param [Hash, nil] options the optional parameters
192
+ # @option options [Float] :error_threshold Defines maximum deviation of points to fitted curve. By default it is 30.
193
+ # @option options [Integer] :max_iterations Defines number of iteration for least-squares approximation method. By default, it is 30.
194
+ # @option options [Integer] :colors_limit The maximum number of colors used to quantize an image. Default value is 25.
195
+ # @option options [Float] :line_width The value of this parameter is affected by the graphics scale. Default value is 1.
196
+ # @return [OperationResult] Result of operation. See OperationResult object.
197
+ def vectorize_storage_to_storage(src, dst, storage, options=nil)
198
+ vectorize(src, dst, false, false, options, storage)
199
+ end
200
+
201
+ # Vectorization an image from to SVG format
202
+ #
203
+ # @param src Full path to source file(bmp, png, gif, tiff, jpeg).
204
+ # @param dst Full path to a result file (svg).
205
+ # @param src_in_local Flag, true if source in the local file.
206
+ # @param dst_in_local Flag, true if result in the local file.
207
+ # @param [Hash, nil] options the optional parameters
208
+ # @option options [Float] :error_threshold Defines maximum deviation of points to fitted curve. By default it is 30.
209
+ # @option options [Integer] :max_iterations Defines number of iteration for least-squares approximation method. By default, it is 30.
210
+ # @option options [Integer] :colors_limit The maximum number of colors used to quantize an image. Default value is 25.
211
+ # @option options [Float] :line_width The value of this parameter is affected by the graphics scale. Default value is 1.
212
+ # @param storage_name Storage name. Default storage is nil.
213
+ # @return [OperationResult] Result of operation. See OperationResult object.
214
+ def vectorize(src, dst, src_in_local, dst_in_local, options=nil, storage_name=nil)
215
+ input_format = get_input_format(src)
216
+ output_format = File.extname(dst).strip.downcase[1..-1]
217
+ fail ApiError.new('Input format must be bmp, jpeg, gif, tiff, png') unless %w[bmp jpeg gif tiff png].include? input_format
218
+ fail ApiError.new('Output format must be SVG') if output_format != 'svg'
219
+ convert(src, dst, src_in_local, dst_in_local, false, options, storage_name)
220
+ end
221
+
222
+
223
+ # Converting a document to various formats
143
224
  #
144
225
  # @param src Source file or URL.
145
- # @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
226
+ # @param dst Full path to a result file.
146
227
  # @param src_in_local Flag, true if source in the local file.
147
228
  # @param dst_in_local Flag, true if result in the local file.
148
229
  # @param is_url Flag, true if source is website.
149
230
  # @param [Hash, nil] options the optional parameters
150
- # @option options [Double] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
151
- # @option options [Double] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
152
- # @option options [Double] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
153
- # @option options [Double] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
154
- # @option options [Double] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
155
- # @option options [Double] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
231
+ # @option options [Float] :width Resulting width. For images in pixels, for PDF, XPS, DOCX in inches.
232
+ # @option options [Float] :height Resulting height. For images in pixels, for PDF, XPS, DOCX in inches.
233
+ # @option options [Float] :left_margin Left resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
234
+ # @option options [Float] :right_margin Right resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
235
+ # @option options [Float] :top_margin Top resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
236
+ # @option options [Float] :bottom_margin Bottom resulting margin. For images in pixels, for PDF, XPS, DOCX in inches.
156
237
  # @param storage_name Storage name. Default storage is nil.
157
- # @return [ConversionResult] Result of conversion. See ConversionResult object.
238
+ # @return [OperationResult] Result of operation. See OperationResult object.
158
239
  def convert(src, dst, src_in_local, dst_in_local, is_url, options=nil, storage_name=nil)
159
240
  if src_in_local
160
241
  res = @storage_api.upload_file("/", src)
@@ -224,7 +305,7 @@ module AsposeHtml
224
305
  :query_params => query_params,
225
306
  :form_params => form_params,
226
307
  :body => post_body,
227
- :return_type => 'ConversionResult')
308
+ :return_type => 'OperationResult')
228
309
  if @api_client.config.debug
229
310
  @api_client.config.logger.debug "API called: Create task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
230
311
  end
@@ -270,7 +351,7 @@ module AsposeHtml
270
351
  :query_params => query_params,
271
352
  :form_params => form_params,
272
353
  :body => post_body,
273
- :return_type => 'ConversionResult')
354
+ :return_type => 'OperationResult')
274
355
 
275
356
  end
276
357
 
@@ -58,7 +58,7 @@ module AsposeHtml
58
58
  @api_client.config.logger.debug 'Calling API: StorageApi.get_disc_usage ...'
59
59
  end
60
60
  # resource path
61
- local_var_path = '/html/storage/disc'
61
+ local_var_path = '/html/storage/disc/usage'
62
62
 
63
63
  # query parameters
64
64
  query_params = {}
@@ -57,7 +57,7 @@ module AsposeHtml
57
57
  'User-Agent' => @user_agent,
58
58
  'Authorization' => "Bearer #{@config.access_token}",
59
59
  'x-aspose-client' => "aspose.html-cloud ruby sdk",
60
- 'x-aspose-client-version' => "22.11.1"
60
+ 'x-aspose-client-version' => "22.12.1"
61
61
  }
62
62
  end
63
63
 
@@ -29,7 +29,7 @@
29
29
  require_relative 'base_model'
30
30
 
31
31
  module AsposeHtml
32
- class ConversionResult < BaseModel
32
+ class OperationResult < BaseModel
33
33
  attr_accessor :code
34
34
 
35
35
  attr_accessor :id
@@ -49,7 +49,7 @@ require 'aspose_html_cloud/models/files_upload_result'
49
49
  require 'aspose_html_cloud/models/object_exist'
50
50
  require 'aspose_html_cloud/models/storage_exist'
51
51
  require 'aspose_html_cloud/models/storage_file'
52
- require 'aspose_html_cloud/models/conversion_result'
52
+ require 'aspose_html_cloud/models/operation_result'
53
53
 
54
54
  module AsposeHtml
55
55
  class << self
@@ -120,7 +120,7 @@ describe 'Test html_api_V4' do
120
120
 
121
121
  expect(answer.code).to eql(200)
122
122
  expect(answer.status).to eql('completed')
123
- expect(@storage_api.object_exists(answer.file)).to be_truthy
123
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
124
124
  end
125
125
  }
126
126
  end
@@ -135,7 +135,7 @@ describe 'Test html_api_V4' do
135
135
 
136
136
  expect(answer.code).to eql(200)
137
137
  expect(answer.status).to eql('completed')
138
- expect(@storage_api.object_exists(answer.file)).to be_truthy
138
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
139
139
  end
140
140
  }
141
141
  end
@@ -159,7 +159,7 @@ describe 'Test html_api_V4' do
159
159
 
160
160
  expect(answer.code).to eql(200)
161
161
  expect(answer.status).to eql('completed')
162
- expect(@storage_api.object_exists(answer.file)).to be_truthy
162
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
163
163
  end
164
164
  }
165
165
  end
@@ -248,7 +248,7 @@ describe 'Test html_api_V4' do
248
248
 
249
249
  expect(answer.code).to eql(200)
250
250
  expect(answer.status).to eql('completed')
251
- expect(@storage_api.object_exists(answer.file)).to be_truthy
251
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
252
252
  end
253
253
  }
254
254
  end
@@ -263,7 +263,7 @@ describe 'Test html_api_V4' do
263
263
 
264
264
  expect(answer.code).to eql(200)
265
265
  expect(answer.status).to eql('completed')
266
- expect(@storage_api.object_exists(answer.file)).to be_truthy
266
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
267
267
  end
268
268
  }
269
269
  end
@@ -287,7 +287,7 @@ describe 'Test html_api_V4' do
287
287
 
288
288
  expect(answer.code).to eql(200)
289
289
  expect(answer.status).to eql('completed')
290
- expect(@storage_api.object_exists(answer.file)).to be_truthy
290
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
291
291
  end
292
292
  }
293
293
  end
@@ -367,7 +367,7 @@ describe 'Test html_api_V4' do
367
367
 
368
368
  expect(answer.code).to eql(200)
369
369
  expect(answer.status).to eql('completed')
370
- expect(@storage_api.object_exists(answer.file)).to be_truthy
370
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
371
371
  end
372
372
  }
373
373
  end
@@ -382,7 +382,7 @@ describe 'Test html_api_V4' do
382
382
 
383
383
  expect(answer.code).to eql(200)
384
384
  expect(answer.status).to eql('completed')
385
- expect(@storage_api.object_exists(answer.file)).to be_truthy
385
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
386
386
  end
387
387
  }
388
388
  end
@@ -406,7 +406,7 @@ describe 'Test html_api_V4' do
406
406
 
407
407
  expect(answer.code).to eql(200)
408
408
  expect(answer.status).to eql('completed')
409
- expect(@storage_api.object_exists(answer.file)).to be_truthy
409
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
410
410
  end
411
411
  }
412
412
  end
@@ -703,6 +703,193 @@ describe 'Test html_api_V4' do
703
703
  end
704
704
  }
705
705
  end
706
+ end
707
+
708
+ describe 'vectorize an image to SVG local to local' do
709
+
710
+ src = File.realpath(__dir__ + '/../../testdata') + '/car.'
711
+ dst_dir = File.realpath(__dir__ + '/../../testresult') + '/'
712
+
713
+ describe 'vectorize to SVG' do
714
+
715
+ %w[bmp jpg gif tiff png].each { |ext|
716
+ it "Vectorize " + ext + " to svg" do
717
+ dst = dst_dir + ext.upcase + 'VectorizetoSVG.svg'
718
+ answer = @html_api.vectorize_local_to_local(src + ext, dst)
719
+
720
+ expect(answer.code).to eql(200)
721
+ expect(answer.status).to eql('completed')
722
+ expect(File.exist?(answer.file)).to be_truthy
723
+ end
724
+ }
725
+ end
726
+
727
+ describe 'vectorize to SVG with options' do
728
+
729
+ %w[bmp jpg gif tiff png].each { |ext|
730
+ it "Vectorize to SVG with opts " + ext do
731
+
732
+ opts = {
733
+ error_threshold: 30,
734
+ max_iterations: 50,
735
+ colors_limit: 3,
736
+ line_width: 2.0,
737
+ }
738
+ dst = dst_dir + ext.upcase + 'VectorizeToSVGWithOpts.svg'
739
+ answer = @html_api.vectorize_local_to_local(src + ext, dst, opts)
740
+
741
+ expect(answer.code).to eql(200)
742
+ expect(answer.status).to eql('completed')
743
+ expect(File.exist?(answer.file)).to be_truthy
744
+ end
745
+ }
746
+ end
747
+ end
748
+
749
+ describe 'vectorize an image to SVG local to storage' do
750
+
751
+ src = File.realpath(__dir__ + '/../../testdata') + '/car.'
752
+ dst_dir = '/VectorizeSvgRuby/'
753
+
754
+ describe 'vectorize to SVG' do
755
+
756
+ %w[bmp jpg gif tiff png].each { |ext|
757
+ it "Vectorize " + ext + " to svg" do
758
+ dst = dst_dir + ext.upcase + 'VectorizetoSVG.svg'
759
+ answer = @html_api.vectorize_local_to_storage(src + ext, dst, nil)
760
+
761
+ expect(answer.code).to eql(200)
762
+ expect(answer.status).to eql('completed')
763
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
764
+ end
765
+ }
766
+ end
767
+
768
+ describe 'vectorize to SVG with options' do
769
+
770
+ %w[bmp jpg gif tiff png].each { |ext|
771
+ it "Vectorize to SVG with opts " + ext do
772
+
773
+ opts = {
774
+ error_threshold: 30,
775
+ max_iterations: 50,
776
+ colors_limit: 3,
777
+ line_width: 2.0,
778
+ }
779
+ dst = dst_dir + ext.upcase + 'VectorizeToSVGWithOpts.svg'
780
+ answer = @html_api.vectorize_local_to_storage(src + ext, dst, opts)
781
+
782
+ expect(answer.code).to eql(200)
783
+ expect(answer.status).to eql('completed')
784
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
785
+ end
786
+ }
787
+ end
788
+ end
789
+
790
+ describe 'vectorize an image to SVG storage to local' do
791
+
792
+ src = File.realpath(__dir__ + '/../../testdata') + '/car.'
793
+ src_dir = '/RubyTest/'
794
+ dst_dir = File.realpath(__dir__ + '/../../testresult') + '/'
795
+
796
+ describe 'vectorize to SVG' do
797
+ %w[bmp jpg gif tiff png].each { |ext|
798
+ it "Vectorize " + ext + " to svg" do
799
+ uploaded_file = src + ext
706
800
 
801
+ res = @storage_api.upload_file(src_dir, uploaded_file)
802
+ expect(res.uploaded.length).to eql(1)
803
+ expect(res.errors.length).to eql(0)
804
+
805
+ dst = dst_dir + ext.upcase + 'StorToLoc.svg'
806
+ answer = @html_api.vectorize_storage_to_local(src_dir + 'car.' + ext, dst, nil)
807
+
808
+ expect(answer.code).to eql(200)
809
+ expect(answer.status).to eql('completed')
810
+ expect(File.exist?(answer.file)).to be_truthy
811
+ end
812
+ }
813
+ end
814
+
815
+ describe 'vectorize to SVG with options' do
816
+
817
+ %w[bmp jpg gif tiff png].each { |ext|
818
+ it "Vectorize to SVG with opts " + ext do
819
+
820
+ opts = {
821
+ error_threshold: 30,
822
+ max_iterations: 50,
823
+ colors_limit: 3,
824
+ line_width: 2.0,
825
+ }
826
+ uploaded_file = src + ext
827
+
828
+ res = @storage_api.upload_file(src_dir, uploaded_file)
829
+ expect(res.uploaded.length).to eql(1)
830
+ expect(res.errors.length).to eql(0)
831
+
832
+ dst = dst_dir + ext.upcase + 'StorToLocWithOpts.svg'
833
+ answer = @html_api.vectorize_storage_to_local(src_dir + 'car.' + ext, dst, nil, opts)
834
+
835
+ expect(answer.code).to eql(200)
836
+ expect(answer.status).to eql('completed')
837
+ expect(File.exist?(answer.file)).to be_truthy
838
+ end
839
+ }
840
+ end
841
+ end
842
+
843
+ describe 'vectorize an image to SVG storage to storage' do
844
+
845
+ src = File.realpath(__dir__ + '/../../testdata') + '/car.'
846
+ src_dir = '/RubyTest/'
847
+
848
+ describe 'vectorize to SVG' do
849
+ %w[bmp jpg gif tiff png].each { |ext|
850
+ it "Vectorize " + ext + " to svg" do
851
+ uploaded_file = src + ext
852
+
853
+ res = @storage_api.upload_file(src_dir, uploaded_file)
854
+ expect(res.uploaded.length).to eql(1)
855
+ expect(res.errors.length).to eql(0)
856
+
857
+ dst = src_dir + ext.upcase + 'StorToStor.svg'
858
+ answer = @html_api.vectorize_storage_to_storage(src_dir + 'car.' + ext, dst, nil)
859
+
860
+ expect(answer.code).to eql(200)
861
+ expect(answer.status).to eql('completed')
862
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
863
+ end
864
+ }
865
+ end
866
+
867
+ describe 'vectorize to SVG with options' do
868
+
869
+ %w[bmp jpg gif tiff png].each { |ext|
870
+ it "Vectorize to SVG with opts " + ext do
871
+
872
+ opts = {
873
+ error_threshold: 30,
874
+ max_iterations: 50,
875
+ colors_limit: 3,
876
+ line_width: 2.0,
877
+ }
878
+ uploaded_file = src + ext
879
+
880
+ res = @storage_api.upload_file(src_dir, uploaded_file)
881
+ expect(res.uploaded.length).to eql(1)
882
+ expect(res.errors.length).to eql(0)
883
+
884
+ dst = src_dir + ext.upcase + 'StorToStorWithOpts.svg'
885
+ answer = @html_api.vectorize_storage_to_storage(src_dir + 'car.' + ext, dst, nil, opts)
886
+
887
+ expect(answer.code).to eql(200)
888
+ expect(answer.status).to eql('completed')
889
+ expect(@storage_api.object_exists(answer.file).exists).to be_truthy
890
+ end
891
+ }
892
+ end
707
893
  end
894
+
708
895
  end
data/spec/spec_helper.rb CHANGED
@@ -30,14 +30,10 @@
30
30
  require 'aspose_html_cloud'
31
31
 
32
32
  CONFIG = {
33
- # "basePath": "https://api.aspose.cloud/v4.0",
34
- # "authPath": "https://api.aspose.cloud/connect/token",
35
- # "apiKey": "c8dda7d6445d82635b8797d1c8edd153",
36
- # "appSID": "2225baa2-097b-4731-9831-d0d56c28230f",
37
- "basePath": "http://localhost:5000/v4.0",
38
- "authPath": "https://api-qa.aspose.cloud/connect/token",
39
- "apiKey": "html.cloud",
40
- "appSID": "html.cloud",
33
+ "basePath": "https://api.aspose.cloud/v4.0",
34
+ "authPath": "https://api.aspose.cloud/connect/token",
35
+ "apiKey": "c8dda7d6445d82635b8797d1c8edd153",
36
+ "appSID": "2225baa2-097b-4731-9831-d0d56c28230f",
41
37
  "debug": true
42
38
  }
43
39
  # from storage api
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_html_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.11.1
4
+ version: 22.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Makogon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-15 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -203,7 +203,6 @@ files:
203
203
  - lib/aspose_html_cloud/api_error.rb
204
204
  - lib/aspose_html_cloud/configuration.rb
205
205
  - lib/aspose_html_cloud/models/base_model.rb
206
- - lib/aspose_html_cloud/models/conversion_result.rb
207
206
  - lib/aspose_html_cloud/models/disc_usage.rb
208
207
  - lib/aspose_html_cloud/models/error.rb
209
208
  - lib/aspose_html_cloud/models/error_details.rb
@@ -212,6 +211,7 @@ files:
212
211
  - lib/aspose_html_cloud/models/files_list.rb
213
212
  - lib/aspose_html_cloud/models/files_upload_result.rb
214
213
  - lib/aspose_html_cloud/models/object_exist.rb
214
+ - lib/aspose_html_cloud/models/operation_result.rb
215
215
  - lib/aspose_html_cloud/models/storage_exist.rb
216
216
  - lib/aspose_html_cloud/models/storage_file.rb
217
217
  - lib/aspose_html_cloud/version.rb