Class: AsposeHtml::HtmlApi

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_html/api/html_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ HtmlApi

Returns a new instance of HtmlApi.



36
37
38
# File 'lib/aspose_html/api/html_api.rb', line 36

def initialize(args)
  @api_client = AsposeHtml::ApiClient.default(args)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



34
35
36
# File 'lib/aspose_html/api/html_api.rb', line 34

def api_client
  @api_client
end

Instance Method Details

#get_convert_document_to_image(name, out_format, opts = {}) ⇒ Hash

Convert the HTML document from the storage by its name to the specified image format.

Parameters:

  • name

    Document name.

  • out_format

    Resulting image format.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :x_resolution (Integer)

    Horizontal resolution of resulting image.

  • :y_resolution (Integer)

    Vertical resolution of resulting image.

  • :folder (String)

    The source document folder.

  • :storage (String)

    The source document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



62
63
64
65
# File 'lib/aspose_html/api/html_api.rb', line 62

def get_convert_document_to_image(name, out_format, opts = {})
  data, _status_code, _headers = get_convert_document_to_image_with_http_info(name, out_format, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_convert_document_to_image_by_url(source_url, out_format, opts = {}) ⇒ Hash

Convert the HTML page from the web by its URL to the specified image format.

Parameters:

  • source_url

    Source page URL.

  • out_format

    Resulting image format.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :x_resolution (Integer)

    Horizontal resolution of resulting image.

  • :y_resolution (Integer)

    Vertical resolution of resulting image.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



151
152
153
154
# File 'lib/aspose_html/api/html_api.rb', line 151

def get_convert_document_to_image_by_url(source_url, out_format, opts = {})
  data, _status_code, _headers = get_convert_document_to_image_by_url_with_http_info(source_url, out_format, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_convert_document_to_image_by_url_with_http_info(source_url, out_format, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Convert the HTML page from the web by its URL to the specified image format.

Parameters:

  • source_url

    Source page URL.

  • out_format

    Resulting image format.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :x_resolution (Integer)

    Horizontal resolution of resulting image.

  • :y_resolution (Integer)

    Vertical resolution of resulting image.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



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
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/aspose_html/api/html_api.rb', line 172

def get_convert_document_to_image_by_url_with_http_info(source_url, out_format, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_image_by_url ..."
  end
  # verify the required parameter 'source_url' is set
  if @api_client.config.client_side_validation && source_url.nil?
    fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_image_by_url"
  end
  # verify the required parameter 'out_format' is set
  if @api_client.config.client_side_validation && out_format.nil?
    fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_convert_document_to_image_by_url"
  end
  # resource path
  local_var_path = "/html/convert/image/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)

  # query parameters
  query_params = {}
  query_params[:'sourceUrl'] = source_url
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'xResolution'] = opts[:'x_resolution'] if !opts[:'x_resolution'].nil?
  query_params[:'yResolution'] = opts[:'y_resolution'] if !opts[:'y_resolution'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_image_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_convert_document_to_image_with_http_info(name, out_format, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Convert the HTML document from the storage by its name to the specified image format.

Parameters:

  • name

    Document name.

  • out_format

    Resulting image format.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :x_resolution (Integer)

    Horizontal resolution of resulting image.

  • :y_resolution (Integer)

    Vertical resolution of resulting image.

  • :folder (String)

    The source document folder.

  • :storage (String)

    The source document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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
# File 'lib/aspose_html/api/html_api.rb', line 83

def get_convert_document_to_image_with_http_info(name, out_format, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_image ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_image"
  end
  # verify the required parameter 'out_format' is set
  if @api_client.config.client_side_validation && out_format.nil?
    fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_convert_document_to_image"
  end
  # resource path
  local_var_path = "/html/{name}/convert/image/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)

  # query parameters
  query_params = {}
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'xResolution'] = opts[:'x_resolution'] if !opts[:'x_resolution'].nil?
  query_params[:'yResolution'] = opts[:'y_resolution'] if !opts[:'y_resolution'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_convert_document_to_pdf(name, opts = {}) ⇒ Hash

Convert the HTML document from the storage by its name to PDF.

Parameters:

  • name

    Document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



238
239
240
241
# File 'lib/aspose_html/api/html_api.rb', line 238

def get_convert_document_to_pdf(name, opts = {})
  data, _status_code, _headers = get_convert_document_to_pdf_with_http_info(name, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_convert_document_to_pdf_by_url(source_url, opts = {}) ⇒ Hash

Convert the HTML page from the web by its URL to PDF.

Parameters:

  • source_url

    Source page URL.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



315
316
317
318
# File 'lib/aspose_html/api/html_api.rb', line 315

def get_convert_document_to_pdf_by_url(source_url, opts = {})
  data, _status_code, _headers = get_convert_document_to_pdf_by_url_with_http_info(source_url, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_convert_document_to_pdf_by_url_with_http_info(source_url, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Convert the HTML page from the web by its URL to PDF.

Parameters:

  • source_url

    Source page URL.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/aspose_html/api/html_api.rb', line 333

def get_convert_document_to_pdf_by_url_with_http_info(source_url, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_pdf_by_url ..."
  end
  # verify the required parameter 'source_url' is set
  if @api_client.config.client_side_validation && source_url.nil?
    fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_pdf_by_url"
  end
  # resource path
  local_var_path = "/html/convert/pdf"

  # query parameters
  query_params = {}
  query_params[:'sourceUrl'] = source_url
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_pdf_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_convert_document_to_pdf_with_http_info(name, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Convert the HTML document from the storage by its name to PDF.

Parameters:

  • name

    Document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/aspose_html/api/html_api.rb', line 256

def get_convert_document_to_pdf_with_http_info(name, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_pdf ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_pdf"
  end
  # resource path
  local_var_path = "/html/{name}/convert/pdf".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_convert_document_to_xps(name, opts = {}) ⇒ Hash

Convert the HTML document from the storage by its name to XPS.

Parameters:

  • name

    Document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



393
394
395
396
# File 'lib/aspose_html/api/html_api.rb', line 393

def get_convert_document_to_xps(name, opts = {})
  data, _status_code, _headers = get_convert_document_to_xps_with_http_info(name, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_convert_document_to_xps_by_url(source_url, opts = {}) ⇒ Hash

Convert the HTML page from the web by its URL to XPS.

Parameters:

  • source_url

    Source page URL.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



470
471
472
473
# File 'lib/aspose_html/api/html_api.rb', line 470

def get_convert_document_to_xps_by_url(source_url, opts = {})
  data, _status_code, _headers = get_convert_document_to_xps_by_url_with_http_info(source_url, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_convert_document_to_xps_by_url_with_http_info(source_url, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Convert the HTML page from the web by its URL to XPS.

Parameters:

  • source_url

    Source page URL.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'lib/aspose_html/api/html_api.rb', line 488

def get_convert_document_to_xps_by_url_with_http_info(source_url, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_xps_by_url ..."
  end
  # verify the required parameter 'source_url' is set
  if @api_client.config.client_side_validation && source_url.nil?
    fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_xps_by_url"
  end
  # resource path
  local_var_path = "/html/convert/xps"

  # query parameters
  query_params = {}
  query_params[:'sourceUrl'] = source_url
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_xps_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_convert_document_to_xps_with_http_info(name, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Convert the HTML document from the storage by its name to XPS.

Parameters:

  • name

    Document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting image width.

  • :height (Integer)

    Resulting image height.

  • :left_margin (Integer)

    Left resulting image margin.

  • :right_margin (Integer)

    Right resulting image margin.

  • :top_margin (Integer)

    Top resulting image margin.

  • :bottom_margin (Integer)

    Bottom resulting image margin.

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/aspose_html/api/html_api.rb', line 411

def get_convert_document_to_xps_with_http_info(name, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_xps ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_xps"
  end
  # resource path
  local_var_path = "/html/{name}/convert/xps".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_detect_html_keywords(name, opts = {}) ⇒ Hash

Get the HTML document keywords using the keyword detection service.

Parameters:

  • name

    Document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

  • :storage (String)

    Document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1794
1795
1796
1797
# File 'lib/aspose_html/api/html_api.rb', line 1794

def get_detect_html_keywords(name, opts = {})
  data, _status_code, _headers = get_detect_html_keywords_with_http_info(name, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_detect_html_keywords_by_url(source_url, opts = {}) ⇒ Hash

Get the keywords from HTML document from Web specified by its URL using the keyword detection service

Parameters:

  • source_url

    Source document URL.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1851
1852
1853
1854
# File 'lib/aspose_html/api/html_api.rb', line 1851

def get_detect_html_keywords_by_url(source_url, opts = {})
  data, _status_code, _headers = get_detect_html_keywords_by_url_with_http_info(source_url, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_detect_html_keywords_by_url_with_http_info(source_url, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Get the keywords from HTML document from Web specified by its URL using the keyword detection service

Parameters:

  • source_url

    Source document URL.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
# File 'lib/aspose_html/api/html_api.rb', line 1861

def get_detect_html_keywords_by_url_with_http_info(source_url, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_detect_html_keywords_by_url ..."
  end
  # verify the required parameter 'source_url' is set
  if @api_client.config.client_side_validation && source_url.nil?
    fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_detect_html_keywords_by_url"
  end
  # resource path
  local_var_path = "/html/summ/keywords"

  # query parameters
  query_params = {}
  query_params[:'sourceUrl'] = source_url

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_detect_html_keywords_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_detect_html_keywords_with_http_info(name, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Get the HTML document keywords using the keyword detection service.

Parameters:

  • name

    Document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

  • :storage (String)

    Document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
# File 'lib/aspose_html/api/html_api.rb', line 1806

def get_detect_html_keywords_with_http_info(name, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_detect_html_keywords ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_detect_html_keywords"
  end
  # resource path
  local_var_path = "/html/{name}/summ/keywords".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_detect_html_keywords\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_document(name, opts = {}) ⇒ Hash

Return the HTML document by the name from default or specified storage.

Parameters:

  • name

    The document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    The document folder

  • :folder (String)

    The document folder.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1054
1055
1056
1057
# File 'lib/aspose_html/api/html_api.rb', line 1054

def get_document(name, opts = {})
  data, _status_code, _headers = get_document_with_http_info(name, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_document_fragment_by_x_path(name, x_path, out_format, opts = {}) ⇒ Hash

Return list of HTML fragments matching the specified XPath query.

Parameters:

  • name

    The document name.

  • x_path

    XPath query string.

  • out_format

    Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    The document storage.

  • :folder (String)

    The document folder.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1115
1116
1117
1118
# File 'lib/aspose_html/api/html_api.rb', line 1115

def get_document_fragment_by_x_path(name, x_path, out_format, opts = {})
  data, _status_code, _headers = get_document_fragment_by_x_path_with_http_info(name, x_path, out_format, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_document_fragment_by_x_path_by_url(source_url, x_path, out_format) ⇒ Hash

Return list of HTML fragments matching the specified XPath query by the source page URL.

Parameters:

  • source_url

    Source page URL.

  • x_path

    XPath query string.

  • out_format

    Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1184
1185
1186
1187
# File 'lib/aspose_html/api/html_api.rb', line 1184

def get_document_fragment_by_x_path_by_url(source_url, x_path, out_format)
  data, _status_code, _headers = get_document_fragment_by_x_path_by_url_with_http_info(source_url, x_path, out_format)
  return {file: data, status: _status_code, headers: _headers}
end

#get_document_fragment_by_x_path_by_url_with_http_info(source_url, x_path, out_format) ⇒ Array<(File, Fixnum, Hash)>

Return list of HTML fragments matching the specified XPath query by the source page URL.

Parameters:

  • source_url

    Source page URL.

  • x_path

    XPath query string.

  • out_format

    Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
# File 'lib/aspose_html/api/html_api.rb', line 1195

def get_document_fragment_by_x_path_by_url_with_http_info(source_url, x_path, out_format)
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: DocumentApi.get_document_fragment_by_x_path_by_url ..."
  end
  # verify the required parameter 'source_url' is set
  if @api_client.config.client_side_validation && source_url.nil?
    fail ArgumentError, "Missing the required parameter 'source_url' when calling DocumentApi.get_document_fragment_by_x_path_by_url"
  end
  # verify the required parameter 'x_path' is set
  if @api_client.config.client_side_validation && x_path.nil?
    fail ArgumentError, "Missing the required parameter 'x_path' when calling DocumentApi.get_document_fragment_by_x_path_by_url"
  end
  # verify the required parameter 'out_format' is set
  if @api_client.config.client_side_validation && out_format.nil?
    fail ArgumentError, "Missing the required parameter 'out_format' when calling DocumentApi.get_document_fragment_by_x_path_by_url"
  end
  # resource path
  local_var_path = "/html/fragments/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)

  # query parameters
  query_params = {}
  query_params[:'sourceUrl'] = source_url
  query_params[:'xPath'] = x_path

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: DocumentApi#get_document_fragment_by_x_path_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_document_fragment_by_x_path_with_http_info(name, x_path, out_format, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Return list of HTML fragments matching the specified XPath query.

Parameters:

  • name

    The document name.

  • x_path

    XPath query string.

  • out_format

    Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    The document storage.

  • :folder (String)

    The document folder.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
# File 'lib/aspose_html/api/html_api.rb', line 1129

def get_document_fragment_by_x_path_with_http_info(name, x_path, out_format, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_document_fragment_by_x_path ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document_fragment_by_x_path"
  end
  # verify the required parameter 'x_path' is set
  if @api_client.config.client_side_validation && x_path.nil?
    fail ArgumentError, "Missing the required parameter 'x_path' when calling HtmlApi.get_document_fragment_by_x_path"
  end
  # verify the required parameter 'out_format' is set
  if @api_client.config.client_side_validation && out_format.nil?
    fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_document_fragment_by_x_path"
  end
  # resource path
  local_var_path = "/html/{name}/fragments/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)

  # query parameters
  query_params = {}
  query_params[:'xPath'] = x_path
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_document_fragment_by_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_document_fragments_by_css_selector(name, selector, out_format, opts = {}) ⇒ Hash

Return list of HTML fragments matching the specified CSS selector.

Parameters:

  • name

    The document name.

  • selector

    CSS selector string.

  • out_format

    Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1252
1253
1254
1255
# File 'lib/aspose_html/api/html_api.rb', line 1252

def get_document_fragments_by_css_selector(name, selector, out_format, opts = {})
  data, _status_code, _headers = get_document_fragments_by_css_selector_with_http_info(name, selector, out_format, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_document_fragments_by_css_selector_by_url(source_url, selector, out_format, opts = {}) ⇒ Hash

Return list of HTML fragments matching the specified CSS selector by the source page URL.

Parameters:

  • source_url

    Source page URL.

  • selector

    CSS selector string.

  • out_format

    Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1322
1323
1324
1325
# File 'lib/aspose_html/api/html_api.rb', line 1322

def get_document_fragments_by_css_selector_by_url(source_url, selector, out_format, opts = {})
  data, _status_code, _headers = get_document_fragments_by_css_selector_by_url_with_http_info(source_url, selector, out_format, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_document_fragments_by_css_selector_by_url_with_http_info(source_url, selector, out_format, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Return list of HTML fragments matching the specified CSS selector by the source page URL.

Parameters:

  • source_url

    Source page URL.

  • selector

    CSS selector string.

  • out_format

    Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'lib/aspose_html/api/html_api.rb', line 1334

def get_document_fragments_by_css_selector_by_url_with_http_info(source_url, selector, out_format, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: DocumentApi.get_document_fragments_by_css_selector_by_url ..."
  end
  # verify the required parameter 'source_url' is set
  if @api_client.config.client_side_validation && source_url.nil?
    fail ArgumentError, "Missing the required parameter 'source_url' when calling DocumentApi.get_document_fragments_by_css_selector_by_url"
  end
  # verify the required parameter 'selector' is set
  if @api_client.config.client_side_validation && selector.nil?
    fail ArgumentError, "Missing the required parameter 'selector' when calling DocumentApi.get_document_fragments_by_css_selector_by_url"
  end
  # verify the required parameter 'out_format' is set
  if @api_client.config.client_side_validation && out_format.nil?
    fail ArgumentError, "Missing the required parameter 'out_format' when calling DocumentApi.get_document_fragments_by_css_selector_by_url"
  end
  # resource path
  local_var_path = "/html/fragments/css/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)

  # query parameters
  query_params = {}
  query_params[:'sourceUrl'] = source_url
  query_params[:'selector'] = selector

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: DocumentApi#get_document_fragments_by_css_selector_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_document_fragments_by_css_selector_with_http_info(name, selector, out_format, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Return list of HTML fragments matching the specified CSS selector.

Parameters:

  • name

    The document name.

  • selector

    CSS selector string.

  • out_format

    Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
# File 'lib/aspose_html/api/html_api.rb', line 1266

def get_document_fragments_by_css_selector_with_http_info(name, selector, out_format, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: DocumentApi.get_document_fragments_by_css_selector ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling DocumentApi.get_document_fragments_by_css_selector"
  end
  # verify the required parameter 'selector' is set
  if @api_client.config.client_side_validation && selector.nil?
    fail ArgumentError, "Missing the required parameter 'selector' when calling DocumentApi.get_document_fragments_by_css_selector"
  end
  # verify the required parameter 'out_format' is set
  if @api_client.config.client_side_validation && out_format.nil?
    fail ArgumentError, "Missing the required parameter 'out_format' when calling DocumentApi.get_document_fragments_by_css_selector"
  end
  # resource path
  local_var_path = "/html/{name}/fragments/css/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)

  # query parameters
  query_params = {}
  query_params[:'selector'] = selector
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: DocumentApi#get_document_fragments_by_css_selector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_document_images(name, opts = {}) ⇒ Hash

Return all HTML document images packaged as a ZIP archive.

Parameters:

  • name

    The document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1389
1390
1391
1392
# File 'lib/aspose_html/api/html_api.rb', line 1389

def get_document_images(name, opts = {})
  data, _status_code, _headers = get_document_images_with_http_info(name, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_document_images_by_url(source_url) ⇒ Hash

Return all HTML page images packaged as a ZIP archive by the source page URL.

Parameters:

  • source_url

    Source page URL.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1446
1447
1448
1449
# File 'lib/aspose_html/api/html_api.rb', line 1446

def get_document_images_by_url(source_url)
  data, _status_code, _headers = get_document_images_by_url_with_http_info(source_url)
  return {file: data, status: _status_code, headers: _headers}
end

#get_document_images_by_url_with_http_info(source_url) ⇒ Array<(File, Fixnum, Hash)>

Return all HTML page images packaged as a ZIP archive by the source page URL.

Parameters:

  • source_url

    Source page URL.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/aspose_html/api/html_api.rb', line 1455

def get_document_images_by_url_with_http_info(source_url)
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: DocumentApi.get_document_images_by_url ..."
  end
  # verify the required parameter 'source_url' is set
  if @api_client.config.client_side_validation && source_url.nil?
    fail ArgumentError, "Missing the required parameter 'source_url' when calling DocumentApi.get_document_images_by_url"
  end
  # resource path
  local_var_path = "/html/images/all"

  # query parameters
  query_params = {}
  query_params[:'sourceUrl'] = source_url

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: DocumentApi#get_document_images_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_document_images_with_http_info(name, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Return all HTML document images packaged as a ZIP archive.

Parameters:

  • name

    The document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :folder (String)

    The document folder.

  • :storage (String)

    The document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
# File 'lib/aspose_html/api/html_api.rb', line 1401

def get_document_images_with_http_info(name, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_document_images ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document_images"
  end
  # resource path
  local_var_path = "/html/{name}/images/all".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_document_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_document_with_http_info(name, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Return the HTML document by the name from default or specified storage.

Parameters:

  • name

    The document name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    The document folder

  • :folder (String)

    The document folder.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
# File 'lib/aspose_html/api/html_api.rb', line 1066

def get_document_with_http_info(name, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_document ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document"
  end
  # resource path
  local_var_path = "/html/{name}".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data', 'application/zip'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_recognize_and_import_to_html(name, opts = {}) ⇒ Hash

Recognize text from the image file in the storage and import it to HTML format.

Parameters:

  • name

    The image file name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ocr_engine_lang (String)

    OCR engine language - language (default to en)

  • :folder (String)

    The source image folder.

  • :storage (String)

    The source image storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1507
1508
1509
1510
# File 'lib/aspose_html/api/html_api.rb', line 1507

def get_recognize_and_import_to_html(name, opts = {})
  data, _status_code, _headers = get_recognize_and_import_to_html_with_http_info(name, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_recognize_and_import_to_html_with_http_info(name, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Recognize text from the image file in the storage and import it to HTML format.

Parameters:

  • name

    The image file name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ocr_engine_lang (String)

    OCR engine language - language default “en”

  • :folder (String)

    The source image folder.

  • :storage (String)

    The source image storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
# File 'lib/aspose_html/api/html_api.rb', line 1520

def get_recognize_and_import_to_html_with_http_info(name, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_recognize_and_import_to_html ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_recognize_and_import_to_html"
  end
  # resource path
  local_var_path = "/html/{name}/ocr/import".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  if opts[:'ocr_engine_lang'].nil?
    query_params[:'ocrEngineLang'] = "en"
  else
    query_params[:'ocrEngineLang'] = opts[:'ocr_engine_lang']
  end

  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_recognize_and_import_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_recognize_and_translate_to_html(name, src_lang, res_lang, opts = {}) ⇒ Hash

Recognize text from the image file in the storage, import it to HTML format and translate to specified language.

Parameters:

  • name

    The image file name.

  • src_lang

    Source language - also supposed as the OCR engine language.

  • res_lang

    Result language.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :folder (String)

    The source image folder.

  • :storage (String)

    The source image storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1575
1576
1577
1578
# File 'lib/aspose_html/api/html_api.rb', line 1575

def get_recognize_and_translate_to_html(name, src_lang, res_lang, opts = {})
  data, _status_code, _headers = get_recognize_and_translate_to_html_with_http_info(name, src_lang, res_lang, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_recognize_and_translate_to_html_with_http_info(name, src_lang, res_lang, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Recognize text from the image file in the storage, import it to HTML format and translate to specified language.

Parameters:

  • name

    The image file name.

  • src_lang

    Source language - also supposed as the OCR engine language.

  • res_lang

    Result language.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :folder (String)

    The source image folder.

  • :storage (String)

    The source image storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
# File 'lib/aspose_html/api/html_api.rb', line 1589

def get_recognize_and_translate_to_html_with_http_info(name, src_lang, res_lang, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_recognize_and_translate_to_html ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_recognize_and_translate_to_html"
  end
  # verify the required parameter 'src_lang' is set
  if @api_client.config.client_side_validation && src_lang.nil?
    fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_recognize_and_translate_to_html"
  end
  # verify the required parameter 'res_lang' is set
  if @api_client.config.client_side_validation && res_lang.nil?
    fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_recognize_and_translate_to_html"
  end
  # resource path
  local_var_path = "/html/{name}/ocr/translate/{srcLang}/{resLang}"
      .sub('{' + 'name' + '}', name.to_s)
      .sub('{' + 'srcLang' + '}', src_lang.to_s)
      .sub('{' + 'resLang' + '}', res_lang.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_recognize_and_translate_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_translate_document(name, src_lang, res_lang, opts = {}) ⇒ Hash

Translate the HTML document specified by the name from default or specified storage.

Parameters:

  • name

    Document name.

  • src_lang

    Source language.

  • res_lang

    Result language.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    The source document storage.

  • :folder (String)

    The source document folder.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1655
1656
1657
1658
# File 'lib/aspose_html/api/html_api.rb', line 1655

def get_translate_document(name, src_lang, res_lang, opts = {})
  data, _status_code, _headers = get_translate_document_with_http_info(name, src_lang, res_lang, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#get_translate_document_by_url(source_url, src_lang, res_lang) ⇒ Hash

Translate the HTML document from Web specified by its URL.

Parameters:

  • source_url

    Source document URL.

  • src_lang

    Source language.

  • res_lang

    Result language.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



1723
1724
1725
1726
# File 'lib/aspose_html/api/html_api.rb', line 1723

def get_translate_document_by_url(source_url, src_lang, res_lang)
  data, _status_code, _headers = get_translate_document_by_url_with_http_info(source_url, src_lang, res_lang)
  return {file: data, status: _status_code, headers: _headers}
end

#get_translate_document_by_url_with_http_info(source_url, src_lang, res_lang) ⇒ Array<(File, Fixnum, Hash)>

Translate the HTML document from Web specified by its URL.

Parameters:

  • source_url

    Source document URL.

  • src_lang

    Source language.

  • res_lang

    Result language.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
# File 'lib/aspose_html/api/html_api.rb', line 1734

def get_translate_document_by_url_with_http_info(source_url, src_lang, res_lang)
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_translate_document_by_url ..."
  end
  # verify the required parameter 'source_url' is set
  if @api_client.config.client_side_validation && source_url.nil?
    fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_translate_document_by_url"
  end
  # verify the required parameter 'src_lang' is set
  if @api_client.config.client_side_validation && src_lang.nil?
    fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_translate_document_by_url"
  end
  # verify the required parameter 'res_lang' is set
  if @api_client.config.client_side_validation && res_lang.nil?
    fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_translate_document_by_url"
  end
  # resource path
  local_var_path = "/html/translate/{srcLang}/{resLang}".sub('{' + 'srcLang' + '}', src_lang.to_s).sub('{' + 'resLang' + '}', res_lang.to_s)

  # query parameters
  query_params = {}
  query_params[:'sourceUrl'] = source_url

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_translate_document_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_translate_document_with_http_info(name, src_lang, res_lang, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Translate the HTML document specified by the name from default or specified storage.

Parameters:

  • name

    Document name.

  • src_lang

    Source language.

  • res_lang

    Result language.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    The source document storage.

  • :folder (String)

    The source document folder.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
# File 'lib/aspose_html/api/html_api.rb', line 1669

def get_translate_document_with_http_info(name, src_lang, res_lang, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: HtmlApi.get_translate_document ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_translate_document"
  end
  # verify the required parameter 'src_lang' is set
  if @api_client.config.client_side_validation && src_lang.nil?
    fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_translate_document"
  end
  # verify the required parameter 'res_lang' is set
  if @api_client.config.client_side_validation && res_lang.nil?
    fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_translate_document"
  end
  # resource path
  local_var_path = "/html/{name}/translate/{srcLang}/{resLang}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'srcLang' + '}', src_lang.to_s).sub('{' + 'resLang' + '}', res_lang.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: HtmlApi#get_translate_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_convert_document_in_request_to_image(out_path, out_format, file, opts = {}) ⇒ Hash

Converts the HTML document (in request content) to the specified image format and uploads resulting file to storage.

Parameters:

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.jpg)

  • out_format
  • file

    A file to be converted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

  • :resolution (Integer)

    Resolution of resulting image. Default is 96 dpi.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



550
551
552
553
# File 'lib/aspose_html/api/html_api.rb', line 550

def put_convert_document_in_request_to_image(out_path, out_format, file, opts = {})
  data, _status_code, _headers = put_convert_document_in_request_to_image_with_http_info(out_path, out_format, file, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#put_convert_document_in_request_to_image_with_http_info(out_path, out_format, file, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Converts the HTML document (in request content) to the specified image format and uploads resulting file to storage.

Parameters:

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.jpg)

  • out_format
  • file

    A file to be converted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

  • :resolution (Integer)

    Resolution of resulting image. Default is 96 dpi.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# File 'lib/aspose_html/api/html_api.rb', line 569

def put_convert_document_in_request_to_image_with_http_info(out_path, out_format, file, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_in_request_to_image ..."
  end
  # verify the required parameter 'out_path' is set
  if @api_client.config.client_side_validation && out_path.nil?
    fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_in_request_to_image"
  end
  # verify the required parameter 'out_format' is set
  if @api_client.config.client_side_validation && out_format.nil?
    fail ArgumentError, "Missing the required parameter 'out_format' when calling ConversionApi.put_convert_document_in_request_to_image"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling ConversionApi.put_convert_document_in_request_to_image"
  end
  # resource path
  local_var_path = "/html/convert/image/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)

  # query parameters
  query_params = {}
  query_params[:'outPath'] = out_path
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'resolution'] = opts[:'resolution'] if !opts[:'resolution'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = ::File.open(file,"rb").read

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_in_request_to_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_convert_document_in_request_to_pdf(out_path, file, opts = {}) ⇒ Hash

Converts the HTML document (in request content) to PDF and uploads resulting file to storage.

Parameters:

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.pdf)

  • file

    A file to be converted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



636
637
638
639
# File 'lib/aspose_html/api/html_api.rb', line 636

def put_convert_document_in_request_to_pdf(out_path, file, opts = {})
  data, _status_code, _headers = put_convert_document_in_request_to_pdf_with_http_info(out_path, file, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#put_convert_document_in_request_to_pdf_with_http_info(out_path, file, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Converts the HTML document (in request content) to PDF and uploads resulting file to storage.

Parameters:

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.pdf)

  • file

    A file to be converted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/aspose_html/api/html_api.rb', line 653

def put_convert_document_in_request_to_pdf_with_http_info(out_path, file, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_in_request_to_pdf ..."
  end
  # verify the required parameter 'out_path' is set
  if @api_client.config.client_side_validation && out_path.nil?
    fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_in_request_to_pdf"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling ConversionApi.put_convert_document_in_request_to_pdf"
  end
  # resource path
  local_var_path = "/html/convert/pdf"

  # query parameters
  query_params = {}
  query_params[:'outPath'] = out_path
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = ::File.open(file,"rb").read
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_in_request_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_convert_document_in_request_to_xps(out_path, file, opts = {}) ⇒ Hash

Converts the HTML document (in request content) to XPS and uploads resulting file to storage.

Parameters:

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.xps)

  • file

    A file to be converted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



714
715
716
717
# File 'lib/aspose_html/api/html_api.rb', line 714

def put_convert_document_in_request_to_xps(out_path, file, opts = {})
  data, _status_code, _headers = put_convert_document_in_request_to_xps_with_http_info(out_path, file, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#put_convert_document_in_request_to_xps_with_http_info(out_path, file, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Converts the HTML document (in request content) to XPS and uploads resulting file to storage.

Parameters:

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.xps)

  • file

    A file to be converted.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
# File 'lib/aspose_html/api/html_api.rb', line 731

def put_convert_document_in_request_to_xps_with_http_info(out_path, file, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_in_request_to_xps ..."
  end
  # verify the required parameter 'out_path' is set
  if @api_client.config.client_side_validation && out_path.nil?
    fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_in_request_to_xps"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling ConversionApi.put_convert_document_in_request_to_xps"
  end
  # resource path
  local_var_path = "/html/convert/xps"

  # query parameters
  query_params = {}
  query_params[:'outPath'] = out_path
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = ::File.open(file,"rb").read
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_in_request_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_convert_document_to_image(name, out_path, out_format, opts = {}) ⇒ Hash

Converts the HTML document (located on storage) to the specified image format and uploads resulting file to storage.

Parameters:

  • name

    Document name.

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.jpg)

  • out_format
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

  • :resolution (Integer)

    Resolution of resulting image. Default is 96 dpi.

  • :folder (String)

    The source document folder.

  • :storage (String)

    The source and resulting document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



796
797
798
799
# File 'lib/aspose_html/api/html_api.rb', line 796

def put_convert_document_to_image(name, out_path, out_format, opts = {})
  data, _status_code, _headers = put_convert_document_to_image_with_http_info(name, out_path, out_format, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#put_convert_document_to_image_with_http_info(name, out_path, out_format, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Converts the HTML document (located on storage) to the specified image format and uploads resulting file to storage.

Parameters:

  • name

    Document name.

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.jpg)

  • out_format
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

  • :resolution (Integer)

    Resolution of resulting image. Default is 96 dpi.

  • :folder (String)

    The source document folder.

  • :storage (String)

    The source and resulting document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
# File 'lib/aspose_html/api/html_api.rb', line 817

def put_convert_document_to_image_with_http_info(name, out_path, out_format, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_to_image ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling ConversionApi.put_convert_document_to_image"
  end
  # verify the required parameter 'out_path' is set
  if @api_client.config.client_side_validation && out_path.nil?
    fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_to_image"
  end
  # verify the required parameter 'out_format' is set
  if @api_client.config.client_side_validation && out_format.nil?
    fail ArgumentError, "Missing the required parameter 'out_format' when calling ConversionApi.put_convert_document_to_image"
  end
  # resource path
  local_var_path = "/html/{name}/convert/image/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)

  # query parameters
  query_params = {}
  query_params[:'outPath'] = out_path
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'resolution'] = opts[:'resolution'] if !opts[:'resolution'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_to_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_convert_document_to_pdf(name, out_path, opts = {}) ⇒ Hash

Converts the HTML document (located on storage) to PDF and uploads resulting file to storage.

Parameters:

  • name

    Document name.

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.pdf)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

  • :folder (String)

    The source document folder.

  • :storage (String)

    The source and resulting document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



887
888
889
890
# File 'lib/aspose_html/api/html_api.rb', line 887

def put_convert_document_to_pdf(name, out_path, opts = {})
  data, _status_code, _headers = put_convert_document_to_pdf_with_http_info(name, out_path, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#put_convert_document_to_pdf_with_http_info(name, out_path, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Converts the HTML document (located on storage) to PDF and uploads resulting file to storage.

Parameters:

  • name

    Document name.

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.pdf)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

  • :folder (String)

    The source document folder.

  • :storage (String)

    The source and resulting document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
# File 'lib/aspose_html/api/html_api.rb', line 906

def put_convert_document_to_pdf_with_http_info(name, out_path, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_to_pdf ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling ConversionApi.put_convert_document_to_pdf"
  end
  # verify the required parameter 'out_path' is set
  if @api_client.config.client_side_validation && out_path.nil?
    fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_to_pdf"
  end
  # resource path
  local_var_path = "/html/{name}/convert/pdf".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'outPath'] = out_path
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_convert_document_to_xps(name, out_path, opts = {}) ⇒ Hash

Converts the HTML document (located on storage) to XPS and uploads resulting file to storage.

Parameters:

  • name

    Document name.

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.xps)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

  • :folder (String)

    The source document folder.

  • :storage (String)

    The source and resulting document storage.

Returns:

  • (Hash)

    data, status: _status_code, headers: _headers



971
972
973
974
# File 'lib/aspose_html/api/html_api.rb', line 971

def put_convert_document_to_xps(name, out_path, opts = {})
  data, _status_code, _headers = put_convert_document_to_xps_with_http_info(name, out_path, opts)
  return {file: data, status: _status_code, headers: _headers}
end

#put_convert_document_to_xps_with_http_info(name, out_path, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Converts the HTML document (located on storage) to XPS and uploads resulting file to storage.

Parameters:

  • name

    Document name.

  • out_path

    Full resulting filename (ex. /folder1/folder2/result.xps)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :width (Integer)

    Resulting document page width in points (1/96 inch).

  • :height (Integer)

    Resulting document page height in points (1/96 inch).

  • :left_margin (Integer)

    Left resulting document page margin in points (1/96 inch).

  • :right_margin (Integer)

    Right resulting document page margin in points (1/96 inch).

  • :top_margin (Integer)

    Top resulting document page margin in points (1/96 inch).

  • :bottom_margin (Integer)

    Bottom resulting document page margin in points (1/96 inch).

  • :folder (String)

    The source document folder.

  • :storage (String)

    The source and resulting document storage.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
# File 'lib/aspose_html/api/html_api.rb', line 990

def put_convert_document_to_xps_with_http_info(name, out_path, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_to_xps ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling ConversionApi.put_convert_document_to_xps"
  end
  # verify the required parameter 'out_path' is set
  if @api_client.config.client_side_validation && out_path.nil?
    fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_to_xps"
  end
  # resource path
  local_var_path = "/html/{name}/convert/xps".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'outPath'] = out_path
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
  query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
  query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end