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)


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

def edit_pdf_add_annotations(request, opts = {})
  data, _status_code, _headers = edit_pdf_add_annotations_with_http_info(request, opts)
  return 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



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

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_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)


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

def edit_pdf_decrypt(password, input_file, opts = {})
  data, _status_code, _headers = edit_pdf_decrypt_with_http_info(password, input_file, opts)
  return 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



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
134
135
136
137
138
139
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 95

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)


148
149
150
151
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 148

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)
  return data
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



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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 160

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)


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

def edit_pdf_encrypt(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_encrypt_with_http_info(input_file, opts)
  return 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



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

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:



281
282
283
284
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 281

def edit_pdf_get_annotations(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_get_annotations_with_http_info(input_file, opts)
  return 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



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

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_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:



337
338
339
340
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 337

def edit_pdf_get_form_fields(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_get_form_fields_with_http_info(input_file, opts)
  return 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



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 347

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:



393
394
395
396
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 393

def (input_file, opts = {})
  data, _status_code, _headers = (input_file, opts)
  return 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



403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 403

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

Returns:



449
450
451
452
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 449

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)
  return 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

Returns:

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

    PdfTextByPageResult data, response status code and response headers



459
460
461
462
463
464
465
466
467
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 459

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'])

  # 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)


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

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)
  return data
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



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
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 523

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_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

Returns:

  • (String)


589
590
591
592
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 589

def edit_pdf_rasterize(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_rasterize_with_http_info(input_file, opts)
  return data
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

Returns:

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

    String data, response status code and response headers



599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 599

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'])

  # 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_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)


645
646
647
648
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 645

def edit_pdf_remove_all_annotations(input_file, opts = {})
  data, _status_code, _headers = edit_pdf_remove_all_annotations_with_http_info(input_file, opts)
  return 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



655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 655

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)


702
703
704
705
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 702

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)
  return 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



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

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_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)


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

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)
  return 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



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

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)


830
831
832
833
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 830

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)
  return 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



843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 843

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)


904
905
906
907
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 904

def edit_pdf_set_form_fields(field_values, opts = {})
  data, _status_code, _headers = edit_pdf_set_form_fields_with_http_info(field_values, opts)
  return 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



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 914

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)


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

def (request, opts = {})
  data, _status_code, _headers = (request, opts)
  return 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



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 969

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)


1024
1025
1026
1027
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1024

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)
  return 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



1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1044

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)


1113
1114
1115
1116
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1113

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)
  return 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



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

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