Class: CloudmersiveConvertApiClient::EditPdfApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EditPdfApi

Returns a new instance of EditPdfApi.



19
20
21
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_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/edit_pdf_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#edit_pdf_add_annotations(request, opts = {}) ⇒ String

Add one or more PDF annotations, comments in the PDF document Adds one or more annotations, comments to a PDF document.

Parameters:

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

    the optional parameters

Returns:

  • (String)


27
28
29
30
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 27

def edit_pdf_add_annotations(request, opts = {})
  data, _status_code, _headers = edit_pdf_add_annotations_with_http_info(request, opts)
  data
end

#edit_pdf_add_annotations_with_http_info(request, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Add one or more PDF annotations, comments in the PDF document Adds one or more annotations, comments to a PDF document.

Parameters:

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



37
38
39
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 37

def edit_pdf_add_annotations_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_add_annotations ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling EditPdfApi.edit_pdf_add_annotations"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/annotations/add-item'

  # 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(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  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: EditPdfApi#edit_pdf_add_annotations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_pdf_convert_to_pdf_a(input_file, opts = {}) ⇒ String

Convert a PDF file to PDF/A Converts the input PDF file to a PDF/A-1b or PDF/A-2b standardized PDF.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :conformance_level (String)

    Optional: Select the conformance level for PDF/A - specify &#39;1b&#39; for PDF/A-1b or specify &#39;2b&#39; for PDF/A-2b; default is PDF/A-1b

Returns:

  • (String)


82
83
84
85
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 82

def edit_pdf_convert_to_pdf_a(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_convert_to_pdf_a_with_http_info(input_file, opts)
  data
end

#edit_pdf_convert_to_pdf_a_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Convert a PDF file to PDF/A Converts the input PDF file to a PDF/A-1b or PDF/A-2b standardized PDF.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :conformance_level (String)

    Optional: Select the conformance level for PDF/A - specify &#39;1b&#39; for PDF/A-1b or specify &#39;2b&#39; for PDF/A-2b; default is PDF/A-1b

Returns:

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

    String data, response status code and response headers



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/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 93

def edit_pdf_convert_to_pdf_a_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_convert_to_pdf_a ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_convert_to_pdf_a"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/optimize/pdf-a'

  # 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'])
  header_params[:'conformanceLevel'] = opts[:'conformance_level'] if !opts[:'conformance_level'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_decrypt(password, input_file, opts = {}) ⇒ String

Decrypt and password-protect a PDF Decrypt a PDF document with a password. Decrypted PDF will no longer require a password to open.

Parameters:

  • password

    Valid password for the PDF file

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

  • (String)


140
141
142
143
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 140

def edit_pdf_decrypt(password, input_file, opts = {})
  data, _status_code, _headers = edit_pdf_decrypt_with_http_info(password, input_file, opts)
  data
end

#edit_pdf_decrypt_with_http_info(password, input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Decrypt and password-protect a PDF Decrypt a PDF document with a password. Decrypted PDF will no longer require a password to open.

Parameters:

  • password

    Valid password for the PDF file

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 151

def edit_pdf_decrypt_with_http_info(password, input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_decrypt ...'
  end
  # verify the required parameter 'password' is set
  if @api_client.config.client_side_validation && password.nil?
    fail ArgumentError, "Missing the required parameter 'password' when calling EditPdfApi.edit_pdf_decrypt"
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_decrypt"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/decrypt'

  # 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'])
  header_params[:'password'] = password

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_delete_pages(input_file, page_start, page_end, opts = {}) ⇒ String

Remove, delete pages from a PDF document Remove one or more pages from a PDF document

Parameters:

  • input_file

    Input file to perform the operation on.

  • page_start

    Page number (1 based) to start deleting pages from (inclusive).

  • page_end

    Page number (1 based) to stop deleting pages from (inclusive).

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

    the optional parameters

Returns:

  • (String)


203
204
205
206
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 203

def edit_pdf_delete_pages(input_file, page_start, page_end, opts = {})
  data, _status_code, _headers = edit_pdf_delete_pages_with_http_info(input_file, page_start, page_end, opts)
  data
end

#edit_pdf_delete_pages_batch_job(input_file, page_start, page_end, opts = {}) ⇒ EditPdfBatchJobCreateResult

Remove, delete pages from a PDF document as Batch Job Remove one or more pages from a PDF document. Runs as a batch job async and returns a batch job ID that you can check the status of to get the result. Requires Cloudmersive Private Cloud or Managed Instance.

Parameters:

  • input_file

    Input file to perform the operation on.

  • page_start

    Page number (1 based) to start deleting pages from (inclusive).

  • page_end

    Page number (1 based) to stop deleting pages from (inclusive).

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

    the optional parameters

Returns:



272
273
274
275
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 272

def edit_pdf_delete_pages_batch_job(input_file, page_start, page_end, opts = {})
  data, _status_code, _headers = edit_pdf_delete_pages_batch_job_with_http_info(input_file, page_start, page_end, opts)
  data
end

#edit_pdf_delete_pages_batch_job_with_http_info(input_file, page_start, page_end, opts = {}) ⇒ Array<(EditPdfBatchJobCreateResult, Fixnum, Hash)>

Remove, delete pages from a PDF document as Batch Job Remove one or more pages from a PDF document. Runs as a batch job async and returns a batch job ID that you can check the status of to get the result. Requires Cloudmersive Private Cloud or Managed Instance.

Parameters:

  • input_file

    Input file to perform the operation on.

  • page_start

    Page number (1 based) to start deleting pages from (inclusive).

  • page_end

    Page number (1 based) to stop deleting pages from (inclusive).

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

    the optional parameters

Returns:



284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 284

def edit_pdf_delete_pages_batch_job_with_http_info(input_file, page_start, page_end, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_delete_pages_batch_job ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_delete_pages_batch_job"
  end
  # verify the required parameter 'page_start' is set
  if @api_client.config.client_side_validation && page_start.nil?
    fail ArgumentError, "Missing the required parameter 'page_start' when calling EditPdfApi.edit_pdf_delete_pages_batch_job"
  end
  # verify the required parameter 'page_end' is set
  if @api_client.config.client_side_validation && page_end.nil?
    fail ArgumentError, "Missing the required parameter 'page_end' when calling EditPdfApi.edit_pdf_delete_pages_batch_job"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/pages/delete/batch-job'

  # 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'])
  header_params[:'pageStart'] = page_start
  header_params[:'pageEnd'] = page_end

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_delete_pages_with_http_info(input_file, page_start, page_end, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Remove, delete pages from a PDF document Remove one or more pages from a PDF document

Parameters:

  • input_file

    Input file to perform the operation on.

  • page_start

    Page number (1 based) to start deleting pages from (inclusive).

  • page_end

    Page number (1 based) to stop deleting pages from (inclusive).

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



215
216
217
218
219
220
221
222
223
224
225
226
227
228
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 215

def edit_pdf_delete_pages_with_http_info(input_file, page_start, page_end, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_delete_pages ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_delete_pages"
  end
  # verify the required parameter 'page_start' is set
  if @api_client.config.client_side_validation && page_start.nil?
    fail ArgumentError, "Missing the required parameter 'page_start' when calling EditPdfApi.edit_pdf_delete_pages"
  end
  # verify the required parameter 'page_end' is set
  if @api_client.config.client_side_validation && page_end.nil?
    fail ArgumentError, "Missing the required parameter 'page_end' when calling EditPdfApi.edit_pdf_delete_pages"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/pages/delete'

  # 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'])
  header_params[:'pageStart'] = page_start
  header_params[:'pageEnd'] = page_end

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_encrypt(input_file, opts = {}) ⇒ String

Encrypt and password-protect a PDF Encrypt a PDF document with a password. Set an owner password to control owner (editor/creator) permissions, and set a user (reader) password to control the viewer of the PDF. Set the password fields null to omit the given password.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :user_password (String)

    Password of a user (reader) of the PDF file

  • :owner_password (String)

    Password of a owner (creator/editor) of the PDF file

  • :encryption_key_length (String)

    Possible values are &quot;128&quot; (128-bit RC4 encryption) and &quot;256&quot; (256-bit AES encryption). Default is 256.

Returns:

  • (String)


342
343
344
345
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 342

def edit_pdf_encrypt(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_encrypt_with_http_info(input_file, opts)
  data
end

#edit_pdf_encrypt_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Encrypt and password-protect a PDF Encrypt a PDF document with a password. Set an owner password to control owner (editor/creator) permissions, and set a user (reader) password to control the viewer of the PDF. Set the password fields null to omit the given password.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :user_password (String)

    Password of a user (reader) of the PDF file

  • :owner_password (String)

    Password of a owner (creator/editor) of the PDF file

  • :encryption_key_length (String)

    Possible values are &quot;128&quot; (128-bit RC4 encryption) and &quot;256&quot; (256-bit AES encryption). Default is 256.

Returns:

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

    String data, response status code and response headers



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 355

def edit_pdf_encrypt_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_encrypt ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_encrypt"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/encrypt'

  # 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'])
  header_params[:'userPassword'] = opts[:'user_password'] if !opts[:'user_password'].nil?
  header_params[:'ownerPassword'] = opts[:'owner_password'] if !opts[:'owner_password'].nil?
  header_params[:'encryptionKeyLength'] = opts[:'encryption_key_length'] if !opts[:'encryption_key_length'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_get_annotations(input_file, opts = {}) ⇒ GetPdfAnnotationsResult

Get PDF annotations, including comments in the document Enumerates the annotations, including comments and notes, in a PDF document.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:



403
404
405
406
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 403

def edit_pdf_get_annotations(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_get_annotations_with_http_info(input_file, opts)
  data
end

#edit_pdf_get_annotations_with_http_info(input_file, opts = {}) ⇒ Array<(GetPdfAnnotationsResult, Fixnum, Hash)>

Get PDF annotations, including comments in the document Enumerates the annotations, including comments and notes, in a PDF document.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

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

    GetPdfAnnotationsResult data, response status code and response headers



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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 413

def edit_pdf_get_annotations_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_get_annotations ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_get_annotations"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/annotations/list'

  # 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['inputFile'] = input_file

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

#edit_pdf_get_async_job_status(async_job_id, opts = {}) ⇒ EditPdfJobStatusResult

Get the status and result of a PDF Batch Job Returns the result of the Async Job - possible states can be STARTED or COMPLETED. This API is only available for Cloudmersive Managed Instance and Private Cloud deployments.

Parameters:

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

    the optional parameters

Returns:



458
459
460
461
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 458

def edit_pdf_get_async_job_status(async_job_id, opts = {})
  data, _status_code, _headers = edit_pdf_get_async_job_status_with_http_info(async_job_id, opts)
  data
end

#edit_pdf_get_async_job_status_with_http_info(async_job_id, opts = {}) ⇒ Array<(EditPdfJobStatusResult, Fixnum, Hash)>

Get the status and result of a PDF Batch Job Returns the result of the Async Job - possible states can be STARTED or COMPLETED. This API is only available for Cloudmersive Managed Instance and Private Cloud deployments.

Parameters:

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

    the optional parameters

Returns:

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

    EditPdfJobStatusResult data, response status code and response headers



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 468

def edit_pdf_get_async_job_status_with_http_info(async_job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_get_async_job_status ...'
  end
  # verify the required parameter 'async_job_id' is set
  if @api_client.config.client_side_validation && async_job_id.nil?
    fail ArgumentError, "Missing the required parameter 'async_job_id' when calling EditPdfApi.edit_pdf_get_async_job_status"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/batch-job/status'

  # query parameters
  query_params = {}
  query_params[:'AsyncJobID'] = async_job_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  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,
    :auth_names => auth_names,
    :return_type => 'EditPdfJobStatusResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditPdfApi#edit_pdf_get_async_job_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_pdf_get_form_fields(input_file, opts = {}) ⇒ PdfFormFields

Gets PDF Form fields and values Encrypt a PDF document with a password. Set an owner password to control owner (editor/creator) permissions, and set a user (reader) password to control the viewer of the PDF. Set the password fields null to omit the given password.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:



511
512
513
514
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 511

def edit_pdf_get_form_fields(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_get_form_fields_with_http_info(input_file, opts)
  data
end

#edit_pdf_get_form_fields_with_http_info(input_file, opts = {}) ⇒ Array<(PdfFormFields, Fixnum, Hash)>

Gets PDF Form fields and values Encrypt a PDF document with a password. Set an owner password to control owner (editor/creator) permissions, and set a user (reader) password to control the viewer of the PDF. Set the password fields null to omit the given password.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

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

    PdfFormFields data, response status code and response headers



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 521

def edit_pdf_get_form_fields_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_get_form_fields ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_get_form_fields"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/form/get-fields'

  # 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['inputFile'] = input_file

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

#edit_pdf_get_metadata(input_file, opts = {}) ⇒ PdfMetadata

Get PDF document metadata Returns the metadata from the PDF document, including Title, Author, etc.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:



566
567
568
569
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 566

def (input_file, opts = {})
  data, _status_code, _headers = (input_file, opts)
  data
end

#edit_pdf_get_metadata_with_http_info(input_file, opts = {}) ⇒ Array<(PdfMetadata, Fixnum, Hash)>

Get PDF document metadata Returns the metadata from the PDF document, including Title, Author, etc.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

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

    PdfMetadata data, response status code and response headers



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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 576

def (input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_get_metadata ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_get_metadata"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/get-metadata'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_get_pdf_text_by_pages(input_file, opts = {}) ⇒ PdfTextByPageResult

Get text in a PDF document by page Gets the text in a PDF by page

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :text_formatting_mode (String)

    Optional; specify how whitespace should be handled when converting the document to text. Possible values are &#39;preserveWhitespace&#39; which will attempt to preserve whitespace in the document and relative positioning of text within the document, and &#39;minimizeWhitespace&#39; which will not insert additional spaces into the document in most cases. Default is &#39;preserveWhitespace&#39;.

Returns:



622
623
624
625
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 622

def edit_pdf_get_pdf_text_by_pages(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_get_pdf_text_by_pages_with_http_info(input_file, opts)
  data
end

#edit_pdf_get_pdf_text_by_pages_with_http_info(input_file, opts = {}) ⇒ Array<(PdfTextByPageResult, Fixnum, Hash)>

Get text in a PDF document by page Gets the text in a PDF by page

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :text_formatting_mode (String)

    Optional; specify how whitespace should be handled when converting the document to text. Possible values are &#39;preserveWhitespace&#39; which will attempt to preserve whitespace in the document and relative positioning of text within the document, and &#39;minimizeWhitespace&#39; which will not insert additional spaces into the document in most cases. Default is &#39;preserveWhitespace&#39;.

Returns:

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

    PdfTextByPageResult data, response status code and response headers



633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 633

def edit_pdf_get_pdf_text_by_pages_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_get_pdf_text_by_pages ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_get_pdf_text_by_pages"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/pages/get-text'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'textFormattingMode'] = opts[:'text_formatting_mode'] if !opts[:'text_formatting_mode'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_insert_pages(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts = {}) ⇒ String

Insert, copy pages from one PDF document into another Copy one or more pages from one PDF document (source document) and insert them into a second PDF document (destination document).

Parameters:

  • source_file

    Source PDF file to copy pages from.

  • destination_file

    Destination PDF file to copy pages into.

  • page_start_source

    Page number (1 based) to start copying pages from (inclusive) in the Source file.

  • page_end_source

    Page number (1 based) to stop copying pages pages from (inclusive) in the Source file.

  • page_insert_before_desitnation

    Page number (1 based) to insert the pages before in the Destination file.

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

    the optional parameters

Returns:

  • (String)


683
684
685
686
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 683

def edit_pdf_insert_pages(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts = {})
  data, _status_code, _headers = edit_pdf_insert_pages_with_http_info(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts)
  data
end

#edit_pdf_insert_pages_batch_job(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts = {}) ⇒ EditPdfBatchJobCreateResult

Insert, copy pages from one PDF document into another as a batch job Copy one or more pages from one PDF document (source document) and insert them into a second PDF document (destination document). Runs as a batch job async and returns a batch job ID that you can check the status of to get the result. Requires Cloudmersive Private Cloud or Managed Instance.

Parameters:

  • source_file

    Source PDF file to copy pages from.

  • destination_file

    Destination PDF file to copy pages into.

  • page_start_source

    Page number (1 based) to start copying pages from (inclusive) in the Source file.

  • page_end_source

    Page number (1 based) to stop copying pages pages from (inclusive) in the Source file.

  • page_insert_before_desitnation

    Page number (1 based) to insert the pages before in the Destination file.

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

    the optional parameters

Returns:



766
767
768
769
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 766

def edit_pdf_insert_pages_batch_job(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts = {})
  data, _status_code, _headers = edit_pdf_insert_pages_batch_job_with_http_info(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts)
  data
end

#edit_pdf_insert_pages_batch_job_with_http_info(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts = {}) ⇒ Array<(EditPdfBatchJobCreateResult, Fixnum, Hash)>

Insert, copy pages from one PDF document into another as a batch job Copy one or more pages from one PDF document (source document) and insert them into a second PDF document (destination document). Runs as a batch job async and returns a batch job ID that you can check the status of to get the result. Requires Cloudmersive Private Cloud or Managed Instance.

Parameters:

  • source_file

    Source PDF file to copy pages from.

  • destination_file

    Destination PDF file to copy pages into.

  • page_start_source

    Page number (1 based) to start copying pages from (inclusive) in the Source file.

  • page_end_source

    Page number (1 based) to stop copying pages pages from (inclusive) in the Source file.

  • page_insert_before_desitnation

    Page number (1 based) to insert the pages before in the Destination file.

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

    the optional parameters

Returns:



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 780

def edit_pdf_insert_pages_batch_job_with_http_info(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_insert_pages_batch_job ...'
  end
  # verify the required parameter 'source_file' is set
  if @api_client.config.client_side_validation && source_file.nil?
    fail ArgumentError, "Missing the required parameter 'source_file' when calling EditPdfApi.edit_pdf_insert_pages_batch_job"
  end
  # verify the required parameter 'destination_file' is set
  if @api_client.config.client_side_validation && destination_file.nil?
    fail ArgumentError, "Missing the required parameter 'destination_file' when calling EditPdfApi.edit_pdf_insert_pages_batch_job"
  end
  # verify the required parameter 'page_start_source' is set
  if @api_client.config.client_side_validation && page_start_source.nil?
    fail ArgumentError, "Missing the required parameter 'page_start_source' when calling EditPdfApi.edit_pdf_insert_pages_batch_job"
  end
  # verify the required parameter 'page_end_source' is set
  if @api_client.config.client_side_validation && page_end_source.nil?
    fail ArgumentError, "Missing the required parameter 'page_end_source' when calling EditPdfApi.edit_pdf_insert_pages_batch_job"
  end
  # verify the required parameter 'page_insert_before_desitnation' is set
  if @api_client.config.client_side_validation && page_insert_before_desitnation.nil?
    fail ArgumentError, "Missing the required parameter 'page_insert_before_desitnation' when calling EditPdfApi.edit_pdf_insert_pages_batch_job"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/pages/insert/batch-job'

  # 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'])
  header_params[:'pageStartSource'] = page_start_source
  header_params[:'pageEndSource'] = page_end_source
  header_params[:'pageInsertBeforeDesitnation'] = page_insert_before_desitnation

  # form parameters
  form_params = {}
  form_params['sourceFile'] = source_file
  form_params['destinationFile'] = destination_file

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

#edit_pdf_insert_pages_with_http_info(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Insert, copy pages from one PDF document into another Copy one or more pages from one PDF document (source document) and insert them into a second PDF document (destination document).

Parameters:

  • source_file

    Source PDF file to copy pages from.

  • destination_file

    Destination PDF file to copy pages into.

  • page_start_source

    Page number (1 based) to start copying pages from (inclusive) in the Source file.

  • page_end_source

    Page number (1 based) to stop copying pages pages from (inclusive) in the Source file.

  • page_insert_before_desitnation

    Page number (1 based) to insert the pages before in the Destination file.

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 697

def edit_pdf_insert_pages_with_http_info(source_file, destination_file, page_start_source, page_end_source, page_insert_before_desitnation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_insert_pages ...'
  end
  # verify the required parameter 'source_file' is set
  if @api_client.config.client_side_validation && source_file.nil?
    fail ArgumentError, "Missing the required parameter 'source_file' when calling EditPdfApi.edit_pdf_insert_pages"
  end
  # verify the required parameter 'destination_file' is set
  if @api_client.config.client_side_validation && destination_file.nil?
    fail ArgumentError, "Missing the required parameter 'destination_file' when calling EditPdfApi.edit_pdf_insert_pages"
  end
  # verify the required parameter 'page_start_source' is set
  if @api_client.config.client_side_validation && page_start_source.nil?
    fail ArgumentError, "Missing the required parameter 'page_start_source' when calling EditPdfApi.edit_pdf_insert_pages"
  end
  # verify the required parameter 'page_end_source' is set
  if @api_client.config.client_side_validation && page_end_source.nil?
    fail ArgumentError, "Missing the required parameter 'page_end_source' when calling EditPdfApi.edit_pdf_insert_pages"
  end
  # verify the required parameter 'page_insert_before_desitnation' is set
  if @api_client.config.client_side_validation && page_insert_before_desitnation.nil?
    fail ArgumentError, "Missing the required parameter 'page_insert_before_desitnation' when calling EditPdfApi.edit_pdf_insert_pages"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/pages/insert'

  # 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'])
  header_params[:'pageStartSource'] = page_start_source
  header_params[:'pageEndSource'] = page_end_source
  header_params[:'pageInsertBeforeDesitnation'] = page_insert_before_desitnation

  # form parameters
  form_params = {}
  form_params['sourceFile'] = source_file
  form_params['destinationFile'] = destination_file

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

#edit_pdf_linearize(input_file, opts = {}) ⇒ String

Linearize and optimize a PDF for streaming download Linearizes the content of a PDF to optimize it for streaming download, particularly over web streaming.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

  • (String)


845
846
847
848
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 845

def edit_pdf_linearize(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_linearize_with_http_info(input_file, opts)
  data
end

#edit_pdf_linearize_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Linearize and optimize a PDF for streaming download Linearizes the content of a PDF to optimize it for streaming download, particularly over web streaming.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 855

def edit_pdf_linearize_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_linearize ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_linearize"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/optimize/linearize'

  # 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['inputFile'] = input_file

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

#edit_pdf_rasterize(input_file, opts = {}) ⇒ String

Rasterize a PDF to an image-based PDF Rasterize a PDF into an image-based PDF. The output is a PDF where each page is comprised of a high-resolution image, with all text, figures and other components removed.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :dpi (Integer)

    Optional; configures the pixel density in Dots per Inch (DPI) (default is 300). This parameter can only be used with Cloudmersive Managed Instance and Private Cloud.

Returns:

  • (String)


901
902
903
904
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 901

def edit_pdf_rasterize(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_rasterize_with_http_info(input_file, opts)
  data
end

#edit_pdf_rasterize_batch_job(input_file, opts = {}) ⇒ EditPdfBatchJobCreateResult

Rasterize a PDF to an image-based PDF as Batch Job Rasterize a PDF into an image-based PDF. The output is a PDF where each page is comprised of a high-resolution image, with all text, figures and other components removed.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:



958
959
960
961
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 958

def edit_pdf_rasterize_batch_job(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_rasterize_batch_job_with_http_info(input_file, opts)
  data
end

#edit_pdf_rasterize_batch_job_with_http_info(input_file, opts = {}) ⇒ Array<(EditPdfBatchJobCreateResult, Fixnum, Hash)>

Rasterize a PDF to an image-based PDF as Batch Job Rasterize a PDF into an image-based PDF. The output is a PDF where each page is comprised of a high-resolution image, with all text, figures and other components removed.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:



968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 968

def edit_pdf_rasterize_batch_job_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_rasterize_batch_job ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_rasterize_batch_job"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/rasterize/batch-job'

  # 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['inputFile'] = input_file

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

#edit_pdf_rasterize_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Rasterize a PDF to an image-based PDF Rasterize a PDF into an image-based PDF. The output is a PDF where each page is comprised of a high-resolution image, with all text, figures and other components removed.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :dpi (Integer)

    Optional; configures the pixel density in Dots per Inch (DPI) (default is 300). This parameter can only be used with Cloudmersive Managed Instance and Private Cloud.

Returns:

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

    String data, response status code and response headers



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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 912

def edit_pdf_rasterize_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_rasterize ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_rasterize"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/rasterize'

  # 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'])
  header_params[:'dpi'] = opts[:'dpi'] if !opts[:'dpi'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_reduce_file_size(input_file, opts = {}) ⇒ String

Reduce the file size and optimize a PDF Reduces the file size and optimizes the content of a PDF to minimize its file size.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :quality (Float)

    Quality level for the images in the PDF, ranging from 0.0 (low quality) to 1.0 (high quality); default is 0.3

Returns:

  • (String)


1014
1015
1016
1017
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1014

def edit_pdf_reduce_file_size(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_reduce_file_size_with_http_info(input_file, opts)
  data
end

#edit_pdf_reduce_file_size_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Reduce the file size and optimize a PDF Reduces the file size and optimizes the content of a PDF to minimize its file size.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :quality (Float)

    Quality level for the images in the PDF, ranging from 0.0 (low quality) to 1.0 (high quality); default is 0.3

Returns:

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

    String data, response status code and response headers



1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1025

def edit_pdf_reduce_file_size_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_reduce_file_size ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_reduce_file_size"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/optimize/reduce-file-size'

  # 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'])
  header_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_remove_all_annotations(input_file, opts = {}) ⇒ String

Remove all PDF annotations, including comments in the document Removes all of the annotations, including comments and notes, in a PDF document.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

  • (String)


1071
1072
1073
1074
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1071

def edit_pdf_remove_all_annotations(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_remove_all_annotations_with_http_info(input_file, opts)
  data
end

#edit_pdf_remove_all_annotations_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Remove all PDF annotations, including comments in the document Removes all of the annotations, including comments and notes, in a PDF document.

Parameters:

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1081

def edit_pdf_remove_all_annotations_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_remove_all_annotations ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_remove_all_annotations"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/annotations/remove-all'

  # 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['inputFile'] = input_file

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

#edit_pdf_remove_annotation_item(input_file, annotation_index, opts = {}) ⇒ String

Remove a specific PDF annotation, comment in the document Removes a specific annotation in a PDF document, using the AnnotationIndex. To enumerate AnnotationIndex for all of the annotations in the PDF document, use the /edit/pdf/annotations/list API.

Parameters:

  • input_file

    Input file to perform the operation on.

  • annotation_index

    The 0-based index of the annotation in the document

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

    the optional parameters

Returns:

  • (String)


1127
1128
1129
1130
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1127

def edit_pdf_remove_annotation_item(input_file, annotation_index, opts = {})
  data, _status_code, _headers = edit_pdf_remove_annotation_item_with_http_info(input_file, annotation_index, opts)
  data
end

#edit_pdf_remove_annotation_item_with_http_info(input_file, annotation_index, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Remove a specific PDF annotation, comment in the document Removes a specific annotation in a PDF document, using the AnnotationIndex. To enumerate AnnotationIndex for all of the annotations in the PDF document, use the /edit/pdf/annotations/list API.

Parameters:

  • input_file

    Input file to perform the operation on.

  • annotation_index

    The 0-based index of the annotation in the document

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



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
1177
1178
1179
1180
1181
1182
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1138

def edit_pdf_remove_annotation_item_with_http_info(input_file, annotation_index, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_remove_annotation_item ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_remove_annotation_item"
  end
  # verify the required parameter 'annotation_index' is set
  if @api_client.config.client_side_validation && annotation_index.nil?
    fail ArgumentError, "Missing the required parameter 'annotation_index' when calling EditPdfApi.edit_pdf_remove_annotation_item"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/annotations/remove-item'

  # 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'])
  header_params[:'annotationIndex'] = annotation_index

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_resize(input_file, paper_size, opts = {}) ⇒ String

Change PDF Document’s Paper Size Resizes a PDF document’s paper size.

Parameters:

  • input_file

    Input file to perform the operation on.

  • paper_size

    The desired paper size for the resized PDF document. Size ranges from A7 (smallest) to A0 (largest).

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

    the optional parameters

Returns:

  • (String)


1189
1190
1191
1192
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1189

def edit_pdf_resize(input_file, paper_size, opts = {})
  data, _status_code, _headers = edit_pdf_resize_with_http_info(input_file, paper_size, opts)
  data
end

#edit_pdf_resize_with_http_info(input_file, paper_size, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Change PDF Document&#39;s Paper Size Resizes a PDF document&#39;s paper size.

Parameters:

  • input_file

    Input file to perform the operation on.

  • paper_size

    The desired paper size for the resized PDF document. Size ranges from A7 (smallest) to A0 (largest).

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



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
1242
1243
1244
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1200

def edit_pdf_resize_with_http_info(input_file, paper_size, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_resize ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_resize"
  end
  # verify the required parameter 'paper_size' is set
  if @api_client.config.client_side_validation && paper_size.nil?
    fail ArgumentError, "Missing the required parameter 'paper_size' when calling EditPdfApi.edit_pdf_resize"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/resize'

  # 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'])
  header_params[:'paperSize'] = paper_size

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_rotate_all_pages(input_file, rotation_angle, opts = {}) ⇒ String

Rotate all pages in a PDF document Rotate all of the pages in a PDF document by a multiple of 90 degrees

Parameters:

  • input_file

    Input file to perform the operation on.

  • rotation_angle

    The angle to rotate the page in degrees, must be a multiple of 90 degrees, e.g. 90, 180, 270, or -90, -180, -270, etc.

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

    the optional parameters

Returns:

  • (String)


1251
1252
1253
1254
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1251

def edit_pdf_rotate_all_pages(input_file, rotation_angle, opts = {})
  data, _status_code, _headers = edit_pdf_rotate_all_pages_with_http_info(input_file, rotation_angle, opts)
  data
end

#edit_pdf_rotate_all_pages_with_http_info(input_file, rotation_angle, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Rotate all pages in a PDF document Rotate all of the pages in a PDF document by a multiple of 90 degrees

Parameters:

  • input_file

    Input file to perform the operation on.

  • rotation_angle

    The angle to rotate the page in degrees, must be a multiple of 90 degrees, e.g. 90, 180, 270, or -90, -180, -270, etc.

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



1262
1263
1264
1265
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1262

def edit_pdf_rotate_all_pages_with_http_info(input_file, rotation_angle, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_rotate_all_pages ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_rotate_all_pages"
  end
  # verify the required parameter 'rotation_angle' is set
  if @api_client.config.client_side_validation && rotation_angle.nil?
    fail ArgumentError, "Missing the required parameter 'rotation_angle' when calling EditPdfApi.edit_pdf_rotate_all_pages"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/pages/rotate/all'

  # 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'])
  header_params[:'rotationAngle'] = rotation_angle

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_rotate_page_range(input_file, rotation_angle, page_start, page_end, opts = {}) ⇒ String

Rotate a range, subset of pages in a PDF document Rotate a range of specific pages in a PDF document by a multiple of 90 degrees

Parameters:

  • input_file

    Input file to perform the operation on.

  • rotation_angle

    The angle to rotate the page in degrees, must be a multiple of 90 degrees, e.g. 90, 180, 270, or -90, -180, -270, etc.

  • page_start

    Page number (1 based) to start rotating pages from (inclusive).

  • page_end

    Page number (1 based) to stop rotating pages from (inclusive).

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

    the optional parameters

Returns:

  • (String)


1315
1316
1317
1318
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1315

def edit_pdf_rotate_page_range(input_file, rotation_angle, page_start, page_end, opts = {})
  data, _status_code, _headers = edit_pdf_rotate_page_range_with_http_info(input_file, rotation_angle, page_start, page_end, opts)
  data
end

#edit_pdf_rotate_page_range_with_http_info(input_file, rotation_angle, page_start, page_end, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Rotate a range, subset of pages in a PDF document Rotate a range of specific pages in a PDF document by a multiple of 90 degrees

Parameters:

  • input_file

    Input file to perform the operation on.

  • rotation_angle

    The angle to rotate the page in degrees, must be a multiple of 90 degrees, e.g. 90, 180, 270, or -90, -180, -270, etc.

  • page_start

    Page number (1 based) to start rotating pages from (inclusive).

  • page_end

    Page number (1 based) to stop rotating pages from (inclusive).

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



1328
1329
1330
1331
1332
1333
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
1381
1382
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1328

def edit_pdf_rotate_page_range_with_http_info(input_file, rotation_angle, page_start, page_end, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_rotate_page_range ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_rotate_page_range"
  end
  # verify the required parameter 'rotation_angle' is set
  if @api_client.config.client_side_validation && rotation_angle.nil?
    fail ArgumentError, "Missing the required parameter 'rotation_angle' when calling EditPdfApi.edit_pdf_rotate_page_range"
  end
  # verify the required parameter 'page_start' is set
  if @api_client.config.client_side_validation && page_start.nil?
    fail ArgumentError, "Missing the required parameter 'page_start' when calling EditPdfApi.edit_pdf_rotate_page_range"
  end
  # verify the required parameter 'page_end' is set
  if @api_client.config.client_side_validation && page_end.nil?
    fail ArgumentError, "Missing the required parameter 'page_end' when calling EditPdfApi.edit_pdf_rotate_page_range"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/pages/rotate/page-range'

  # 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'])
  header_params[:'rotationAngle'] = rotation_angle
  header_params[:'pageStart'] = page_start
  header_params[:'pageEnd'] = page_end

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_set_form_fields(field_values, opts = {}) ⇒ String

Sets ands fills PDF Form field values Fill in the form fields in a PDF form with specific values. Use form/get-fields to enumerate the available fields and their data types in an input form.

Parameters:

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

    the optional parameters

Returns:

  • (String)


1388
1389
1390
1391
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1388

def edit_pdf_set_form_fields(field_values, opts = {})
  data, _status_code, _headers = edit_pdf_set_form_fields_with_http_info(field_values, opts)
  data
end

#edit_pdf_set_form_fields_with_http_info(field_values, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Sets ands fills PDF Form field values Fill in the form fields in a PDF form with specific values. Use form/get-fields to enumerate the available fields and their data types in an input form.

Parameters:

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



1398
1399
1400
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1398

def edit_pdf_set_form_fields_with_http_info(field_values, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_set_form_fields ...'
  end
  # verify the required parameter 'field_values' is set
  if @api_client.config.client_side_validation && field_values.nil?
    fail ArgumentError, "Missing the required parameter 'field_values' when calling EditPdfApi.edit_pdf_set_form_fields"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/form/set-fields'

  # 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(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(field_values)
  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: EditPdfApi#edit_pdf_set_form_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_pdf_set_metadata(request, opts = {}) ⇒ String

Sets PDF document metadata Sets (writes) metadata into the input PDF document, including Title, Author, etc.

Parameters:

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

    the optional parameters

Returns:

  • (String)


1442
1443
1444
1445
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1442

def (request, opts = {})
  data, _status_code, _headers = (request, opts)
  data
end

#edit_pdf_set_metadata_with_http_info(request, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Sets PDF document metadata Sets (writes) metadata into the input PDF document, including Title, Author, etc.

Parameters:

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



1452
1453
1454
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1452

def (request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_set_metadata ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling EditPdfApi.edit_pdf_set_metadata"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/set-metadata'

  # 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(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  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: EditPdfApi#edit_pdf_set_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_pdf_set_permissions(owner_password, user_password, input_file, opts = {}) ⇒ String

Encrypt, password-protect and set restricted permissions on a PDF Encrypt a PDF document with a password, and set permissions on the PDF. Set an owner password to control owner (editor/creator) permissions [required], and set a user (reader) password to control the viewer of the PDF [optional]. Set the reader password to null to omit the password. Restrict or allow printing, copying content, document assembly, editing (read-only), form filling, modification of annotations, and degraded printing through document Digital Rights Management (DRM).

Parameters:

  • owner_password

    Password of a owner (creator/editor) of the PDF file (required)

  • user_password

    Password of a user (reader) of the PDF file (optional)

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :encryption_key_length (String)

    Possible values are &quot;128&quot; (128-bit RC4 encryption) and &quot;256&quot; (256-bit AES encryption). Default is 256.

  • :allow_printing (BOOLEAN)

    Set to false to disable printing through DRM. Default is true.

  • :allow_document_assembly (BOOLEAN)

    Set to false to disable document assembly through DRM. Default is true.

  • :allow_content_extraction (BOOLEAN)

    Set to false to disable copying/extracting content out of the PDF through DRM. Default is true.

  • :allow_form_filling (BOOLEAN)

    Set to false to disable filling out form fields in the PDF through DRM. Default is true.

  • :allow_editing (BOOLEAN)

    Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true.

  • :allow_annotations (BOOLEAN)

    Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true.

  • :allow_degraded_printing (BOOLEAN)

    Set to false to disable degraded printing of the PDF through DRM. Default is true.

Returns:

  • (String)


1506
1507
1508
1509
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1506

def edit_pdf_set_permissions(owner_password, user_password, input_file, opts = {})
  data, _status_code, _headers = edit_pdf_set_permissions_with_http_info(owner_password, user_password, input_file, opts)
  data
end

#edit_pdf_set_permissions_with_http_info(owner_password, user_password, input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Encrypt, password-protect and set restricted permissions on a PDF Encrypt a PDF document with a password, and set permissions on the PDF. Set an owner password to control owner (editor/creator) permissions [required], and set a user (reader) password to control the viewer of the PDF [optional]. Set the reader password to null to omit the password. Restrict or allow printing, copying content, document assembly, editing (read-only), form filling, modification of annotations, and degraded printing through document Digital Rights Management (DRM).

Parameters:

  • owner_password

    Password of a owner (creator/editor) of the PDF file (required)

  • user_password

    Password of a user (reader) of the PDF file (optional)

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :encryption_key_length (String)

    Possible values are &quot;128&quot; (128-bit RC4 encryption) and &quot;256&quot; (256-bit AES encryption). Default is 256.

  • :allow_printing (BOOLEAN)

    Set to false to disable printing through DRM. Default is true.

  • :allow_document_assembly (BOOLEAN)

    Set to false to disable document assembly through DRM. Default is true.

  • :allow_content_extraction (BOOLEAN)

    Set to false to disable copying/extracting content out of the PDF through DRM. Default is true.

  • :allow_form_filling (BOOLEAN)

    Set to false to disable filling out form fields in the PDF through DRM. Default is true.

  • :allow_editing (BOOLEAN)

    Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true.

  • :allow_annotations (BOOLEAN)

    Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true.

  • :allow_degraded_printing (BOOLEAN)

    Set to false to disable degraded printing of the PDF through DRM. Default is true.

Returns:

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

    String data, response status code and response headers



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
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1526

def edit_pdf_set_permissions_with_http_info(owner_password, user_password, input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_set_permissions ...'
  end
  # verify the required parameter 'owner_password' is set
  if @api_client.config.client_side_validation && owner_password.nil?
    fail ArgumentError, "Missing the required parameter 'owner_password' when calling EditPdfApi.edit_pdf_set_permissions"
  end
  # verify the required parameter 'user_password' is set
  if @api_client.config.client_side_validation && user_password.nil?
    fail ArgumentError, "Missing the required parameter 'user_password' when calling EditPdfApi.edit_pdf_set_permissions"
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_set_permissions"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/encrypt/set-permissions'

  # 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'])
  header_params[:'ownerPassword'] = owner_password
  header_params[:'userPassword'] = user_password
  header_params[:'encryptionKeyLength'] = opts[:'encryption_key_length'] if !opts[:'encryption_key_length'].nil?
  header_params[:'allowPrinting'] = opts[:'allow_printing'] if !opts[:'allow_printing'].nil?
  header_params[:'allowDocumentAssembly'] = opts[:'allow_document_assembly'] if !opts[:'allow_document_assembly'].nil?
  header_params[:'allowContentExtraction'] = opts[:'allow_content_extraction'] if !opts[:'allow_content_extraction'].nil?
  header_params[:'allowFormFilling'] = opts[:'allow_form_filling'] if !opts[:'allow_form_filling'].nil?
  header_params[:'allowEditing'] = opts[:'allow_editing'] if !opts[:'allow_editing'].nil?
  header_params[:'allowAnnotations'] = opts[:'allow_annotations'] if !opts[:'allow_annotations'].nil?
  header_params[:'allowDegradedPrinting'] = opts[:'allow_degraded_printing'] if !opts[:'allow_degraded_printing'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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

#edit_pdf_watermark_text(watermark_text, input_file, opts = {}) ⇒ String

Add a text watermark to a PDF Adds a text watermark to a PDF

Parameters:

  • watermark_text

    Watermark text to add to the PDF (required)

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :font_name (String)

    Font Family Name for the watermark text; default is Times New Roman

  • :font_size (Float)

    Font Size in points of the text; default is 150

  • :font_color (String)

    Font color in hexadecimal or HTML color name; default is Red

  • :font_transparency (Float)

    Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5

Returns:

  • (String)


1594
1595
1596
1597
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1594

def edit_pdf_watermark_text(watermark_text, input_file, opts = {})
  data, _status_code, _headers = edit_pdf_watermark_text_with_http_info(watermark_text, input_file, opts)
  data
end

#edit_pdf_watermark_text_with_http_info(watermark_text, input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Add a text watermark to a PDF Adds a text watermark to a PDF

Parameters:

  • watermark_text

    Watermark text to add to the PDF (required)

  • input_file

    Input file to perform the operation on.

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

    the optional parameters

Options Hash (opts):

  • :font_name (String)

    Font Family Name for the watermark text; default is Times New Roman

  • :font_size (Float)

    Font Size in points of the text; default is 150

  • :font_color (String)

    Font color in hexadecimal or HTML color name; default is Red

  • :font_transparency (Float)

    Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5

Returns:

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

    String data, response status code and response headers



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
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1609

def edit_pdf_watermark_text_with_http_info(watermark_text, input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EditPdfApi.edit_pdf_watermark_text ...'
  end
  # verify the required parameter 'watermark_text' is set
  if @api_client.config.client_side_validation && watermark_text.nil?
    fail ArgumentError, "Missing the required parameter 'watermark_text' when calling EditPdfApi.edit_pdf_watermark_text"
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_watermark_text"
  end
  # resource path
  local_var_path = '/convert/edit/pdf/watermark/text'

  # 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'])
  header_params[:'watermarkText'] = watermark_text
  header_params[:'fontName'] = opts[:'font_name'] if !opts[:'font_name'].nil?
  header_params[:'fontSize'] = opts[:'font_size'] if !opts[:'font_size'].nil?
  header_params[:'fontColor'] = opts[:'font_color'] if !opts[:'font_color'].nil?
  header_params[:'fontTransparency'] = opts[:'font_transparency'] if !opts[:'font_transparency'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

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