Class: CloudmersiveConvertApiClient::MergeDocumentApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudmersive-convert-api-client/api/merge_document_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MergeDocumentApi

Returns a new instance of MergeDocumentApi.



19
20
21
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#merge_document_docx(input_file1, input_file2, opts = {}) ⇒ String

Merge Multple Word DOCX Together Combine multiple Office Word Documents (docx) into one single Office Word document

Parameters:

  • input_file1

    First input file to perform the operation on.

  • input_file2

    Second input file to perform the operation on (more than 2 can be supplied).

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

    the optional parameters

Returns:

  • (String)


29
30
31
32
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 29

def merge_document_docx(input_file1, input_file2, opts = {})
  data, _status_code, _headers = merge_document_docx_with_http_info(input_file1, input_file2, opts)
  return data
end

#merge_document_docx_with_http_info(input_file1, input_file2, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Merge Multple Word DOCX Together Combine multiple Office Word Documents (docx) into one single Office Word document

Parameters:

  • input_file1

    First input file to perform the operation on.

  • input_file2

    Second input file to perform the operation on (more than 2 can be supplied).

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 40

def merge_document_docx_with_http_info(input_file1, input_file2, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MergeDocumentApi.merge_document_docx ..."
  end
  # verify the required parameter 'input_file1' is set
  if @api_client.config.client_side_validation && input_file1.nil?
    fail ArgumentError, "Missing the required parameter 'input_file1' when calling MergeDocumentApi.merge_document_docx"
  end
  # verify the required parameter 'input_file2' is set
  if @api_client.config.client_side_validation && input_file2.nil?
    fail ArgumentError, "Missing the required parameter 'input_file2' when calling MergeDocumentApi.merge_document_docx"
  end
  # resource path
  local_var_path = "/convert/merge/docx"

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}
  form_params["inputFile1"] = input_file1
  form_params["inputFile2"] = input_file2

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MergeDocumentApi#merge_document_docx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#merge_document_pdf(input_file1, input_file2, opts = {}) ⇒ String

Merge Multple PDF Files Together Combine multiple PDF files (pdf) into a single PDF document, preserving the order of the input documents in the combined document

Parameters:

  • input_file1

    First input file to perform the operation on.

  • input_file2

    Second input file to perform the operation on (more than 2 can be supplied).

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

    the optional parameters

Returns:

  • (String)


92
93
94
95
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 92

def merge_document_pdf(input_file1, input_file2, opts = {})
  data, _status_code, _headers = merge_document_pdf_with_http_info(input_file1, input_file2, opts)
  return data
end

#merge_document_pdf_with_http_info(input_file1, input_file2, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Merge Multple PDF Files Together Combine multiple PDF files (pdf) into a single PDF document, preserving the order of the input documents in the combined document

Parameters:

  • input_file1

    First input file to perform the operation on.

  • input_file2

    Second input file to perform the operation on (more than 2 can be supplied).

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 103

def merge_document_pdf_with_http_info(input_file1, input_file2, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MergeDocumentApi.merge_document_pdf ..."
  end
  # verify the required parameter 'input_file1' is set
  if @api_client.config.client_side_validation && input_file1.nil?
    fail ArgumentError, "Missing the required parameter 'input_file1' when calling MergeDocumentApi.merge_document_pdf"
  end
  # verify the required parameter 'input_file2' is set
  if @api_client.config.client_side_validation && input_file2.nil?
    fail ArgumentError, "Missing the required parameter 'input_file2' when calling MergeDocumentApi.merge_document_pdf"
  end
  # resource path
  local_var_path = "/convert/merge/pdf"

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}
  form_params["inputFile1"] = input_file1
  form_params["inputFile2"] = input_file2

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MergeDocumentApi#merge_document_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#merge_document_pptx(input_file1, input_file2, opts = {}) ⇒ String

Merge Multple PowerPoint PPTX Together Combine multiple Office PowerPoint presentations (pptx) into one single Office PowerPoint presentation

Parameters:

  • input_file1

    First input file to perform the operation on.

  • input_file2

    Second input file to perform the operation on (more than 2 can be supplied).

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

    the optional parameters

Returns:

  • (String)


155
156
157
158
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 155

def merge_document_pptx(input_file1, input_file2, opts = {})
  data, _status_code, _headers = merge_document_pptx_with_http_info(input_file1, input_file2, opts)
  return data
end

#merge_document_pptx_with_http_info(input_file1, input_file2, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Merge Multple PowerPoint PPTX Together Combine multiple Office PowerPoint presentations (pptx) into one single Office PowerPoint presentation

Parameters:

  • input_file1

    First input file to perform the operation on.

  • input_file2

    Second input file to perform the operation on (more than 2 can be supplied).

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 166

def merge_document_pptx_with_http_info(input_file1, input_file2, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MergeDocumentApi.merge_document_pptx ..."
  end
  # verify the required parameter 'input_file1' is set
  if @api_client.config.client_side_validation && input_file1.nil?
    fail ArgumentError, "Missing the required parameter 'input_file1' when calling MergeDocumentApi.merge_document_pptx"
  end
  # verify the required parameter 'input_file2' is set
  if @api_client.config.client_side_validation && input_file2.nil?
    fail ArgumentError, "Missing the required parameter 'input_file2' when calling MergeDocumentApi.merge_document_pptx"
  end
  # resource path
  local_var_path = "/convert/merge/pptx"

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}
  form_params["inputFile1"] = input_file1
  form_params["inputFile2"] = input_file2

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MergeDocumentApi#merge_document_pptx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#merge_document_xlsx(input_file1, input_file2, opts = {}) ⇒ String

Merge Multple Excel XLSX Together Combine multiple Office Excel spreadsheets (xlsx) into a single Office Excel spreadsheet

Parameters:

  • input_file1

    First input file to perform the operation on.

  • input_file2

    Second input file to perform the operation on (more than 2 can be supplied).

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

    the optional parameters

Returns:

  • (String)


218
219
220
221
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 218

def merge_document_xlsx(input_file1, input_file2, opts = {})
  data, _status_code, _headers = merge_document_xlsx_with_http_info(input_file1, input_file2, opts)
  return data
end

#merge_document_xlsx_with_http_info(input_file1, input_file2, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Merge Multple Excel XLSX Together Combine multiple Office Excel spreadsheets (xlsx) into a single Office Excel spreadsheet

Parameters:

  • input_file1

    First input file to perform the operation on.

  • input_file2

    Second input file to perform the operation on (more than 2 can be supplied).

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/cloudmersive-convert-api-client/api/merge_document_api.rb', line 229

def merge_document_xlsx_with_http_info(input_file1, input_file2, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MergeDocumentApi.merge_document_xlsx ..."
  end
  # verify the required parameter 'input_file1' is set
  if @api_client.config.client_side_validation && input_file1.nil?
    fail ArgumentError, "Missing the required parameter 'input_file1' when calling MergeDocumentApi.merge_document_xlsx"
  end
  # verify the required parameter 'input_file2' is set
  if @api_client.config.client_side_validation && input_file2.nil?
    fail ArgumentError, "Missing the required parameter 'input_file2' when calling MergeDocumentApi.merge_document_xlsx"
  end
  # resource path
  local_var_path = "/convert/merge/xlsx"

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}
  form_params["inputFile1"] = input_file1
  form_params["inputFile2"] = input_file2

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MergeDocumentApi#merge_document_xlsx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end