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


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

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



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

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:



334
335
336
337
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 334

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



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

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:



389
390
391
392
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 389

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



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

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:



444
445
446
447
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 444

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



454
455
456
457
458
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 454

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:



500
501
502
503
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 500

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



511
512
513
514
515
516
517
518
519
520
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
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 511

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)


561
562
563
564
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 561

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



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 575

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)


640
641
642
643
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 640

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



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

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

Returns:

  • (String)


695
696
697
698
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 695

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



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

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

Returns:

  • (String)


750
751
752
753
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 750

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

Returns:

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

    String data, response status code and response headers



760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 760

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

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


805
806
807
808
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 805

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



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
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 815

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)


861
862
863
864
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 861

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



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
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 872

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)


923
924
925
926
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 923

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



934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 934

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)


985
986
987
988
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 985

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



996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 996

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)


1049
1050
1051
1052
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1049

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



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
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1062

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)


1122
1123
1124
1125
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1122

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



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

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)


1176
1177
1178
1179
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1176

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



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1186

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)


1240
1241
1242
1243
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1240

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



1260
1261
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
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1260

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)


1328
1329
1330
1331
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1328

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



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
1383
1384
1385
1386
1387
1388
1389
1390
1391
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 1343

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