cloudmersive-convert-api-client 1.4.5 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8af4db4d5d0384f9d40d9b2b77c0d3a6cf656e702ae860030316dba745c6134c
4
- data.tar.gz: b2cb08fa6a248f7cb91a585c18fb5da694690078930b0ed878329ea2e61bd2ea
3
+ metadata.gz: 233e4225e3af6e5aaa826509f21d4ae2e58fcf695ae8641449cd8fb71c12697c
4
+ data.tar.gz: b68efacc9f4eb4867092e06c9cc1f72a1435d48093942557225d432ea6359fe5
5
5
  SHA512:
6
- metadata.gz: 60b3555ef1224a9b55bcec2105427035ca866031305c9ff2c9aec471027beb7e831e09588218598019fbe1f0120b5ebb14c98eb583ef56186be5202de2999682
7
- data.tar.gz: b4e57feca16a15b6404160884d0e40dfbeacbd954e90e391eeba7f47d5958e363aa2bd58acd9f4f8ce104fad4e437c53731f4a01386337a23b3784306e3d171f
6
+ metadata.gz: f0ba46e56b989387acf8502dd63b1b6f671aefc37aed40cf6ff648e99f9a1432a0562c830cd573a3561714ae286114e2e28a5a136d77b1880d4b0a7326c0b599
7
+ data.tar.gz: 3085405b610bd132ad4489b0f16a8f15989bd34a2b1be717f89d08f2a9043b43b21900829cab6fd733097fd0d19100c0959cc7a2e1f9876f25ab0206860b3c33
data/README.md CHANGED
@@ -7,7 +7,7 @@ Convert API lets you effortlessly convert file formats and types.
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 1.4.5
10
+ - Package version: 1.4.6
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-convert-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-convert-api-client-1.4.5.gem
26
+ gem install ./cloudmersive-convert-api-client-1.4.6.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-convert-api-client-1.4.5.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-convert-api-client-1.4.6.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-convert-api-client', '~> 1.4.5'
34
+ gem 'cloudmersive-convert-api-client', '~> 1.4.6'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -151,6 +151,9 @@ Class | Method | HTTP request | Description
151
151
  *CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_xlsx_get_styles**](docs/EditDocumentApi.md#edit_document_xlsx_get_styles) | **POST** /convert/edit/xlsx/get-styles | Get styles from a XLSX worksheet
152
152
  *CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_xlsx_get_worksheets**](docs/EditDocumentApi.md#edit_document_xlsx_get_worksheets) | **POST** /convert/edit/xlsx/get-worksheets | Get worksheets from a XLSX
153
153
  *CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_xlsx_insert_worksheet**](docs/EditDocumentApi.md#edit_document_xlsx_insert_worksheet) | **POST** /convert/edit/xlsx/insert-worksheet | Insert a new worksheet into an XLSX spreadsheet
154
+ *CloudmersiveConvertApiClient::EditPdfApi* | [**edit_pdf_encrypt**](docs/EditPdfApi.md#edit_pdf_encrypt) | **POST** /convert/edit/pdf/encrypt | Encrypt and password-protect a PDF
155
+ *CloudmersiveConvertApiClient::EditPdfApi* | [**edit_pdf_set_permissions**](docs/EditPdfApi.md#edit_pdf_set_permissions) | **POST** /convert/edit/pdf/encrypt/set-permissions | Encrypt, password-protect and set restricted permissions on a PDF
156
+ *CloudmersiveConvertApiClient::EditPdfApi* | [**edit_pdf_watermark_text**](docs/EditPdfApi.md#edit_pdf_watermark_text) | **POST** /convert/edit/pdf/watermark/text | Add a text watermark to a PDF
154
157
  *CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_docx**](docs/MergeDocumentApi.md#merge_document_docx) | **POST** /convert/merge/docx | Merge Multple Word DOCX Together
155
158
  *CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_pdf**](docs/MergeDocumentApi.md#merge_document_pdf) | **POST** /convert/merge/pdf | Merge Multple PDF Files Together
156
159
  *CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_png**](docs/MergeDocumentApi.md#merge_document_png) | **POST** /convert/merge/png/vertical | Merge Multple PNG Files Together
@@ -0,0 +1,213 @@
1
+ # CloudmersiveConvertApiClient::EditPdfApi
2
+
3
+ All URIs are relative to *https://api.cloudmersive.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**edit_pdf_encrypt**](EditPdfApi.md#edit_pdf_encrypt) | **POST** /convert/edit/pdf/encrypt | Encrypt and password-protect a PDF
8
+ [**edit_pdf_set_permissions**](EditPdfApi.md#edit_pdf_set_permissions) | **POST** /convert/edit/pdf/encrypt/set-permissions | Encrypt, password-protect and set restricted permissions on a PDF
9
+ [**edit_pdf_watermark_text**](EditPdfApi.md#edit_pdf_watermark_text) | **POST** /convert/edit/pdf/watermark/text | Add a text watermark to a PDF
10
+
11
+
12
+ # **edit_pdf_encrypt**
13
+ > String edit_pdf_encrypt(input_file, opts)
14
+
15
+ Encrypt and password-protect a PDF
16
+
17
+ 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.
18
+
19
+ ### Example
20
+ ```ruby
21
+ # load the gem
22
+ require 'cloudmersive-convert-api-client'
23
+ # setup authorization
24
+ CloudmersiveConvertApiClient.configure do |config|
25
+ # Configure API key authorization: Apikey
26
+ config.api_key['Apikey'] = 'YOUR API KEY'
27
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
28
+ #config.api_key_prefix['Apikey'] = 'Bearer'
29
+ end
30
+
31
+ api_instance = CloudmersiveConvertApiClient::EditPdfApi.new
32
+
33
+ input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
34
+
35
+ opts = {
36
+ user_password: "user_password_example", # String | Password of a user (reader) of the PDF file
37
+ owner_password: "owner_password_example" # String | Password of a owner (creator/editor) of the PDF file
38
+ }
39
+
40
+ begin
41
+ #Encrypt and password-protect a PDF
42
+ result = api_instance.edit_pdf_encrypt(input_file, opts)
43
+ p result
44
+ rescue CloudmersiveConvertApiClient::ApiError => e
45
+ puts "Exception when calling EditPdfApi->edit_pdf_encrypt: #{e}"
46
+ end
47
+ ```
48
+
49
+ ### Parameters
50
+
51
+ Name | Type | Description | Notes
52
+ ------------- | ------------- | ------------- | -------------
53
+ **input_file** | **File**| Input file to perform the operation on. |
54
+ **user_password** | **String**| Password of a user (reader) of the PDF file | [optional]
55
+ **owner_password** | **String**| Password of a owner (creator/editor) of the PDF file | [optional]
56
+
57
+ ### Return type
58
+
59
+ **String**
60
+
61
+ ### Authorization
62
+
63
+ [Apikey](../README.md#Apikey)
64
+
65
+ ### HTTP request headers
66
+
67
+ - **Content-Type**: multipart/form-data
68
+ - **Accept**: application/octet-stream
69
+
70
+
71
+
72
+ # **edit_pdf_set_permissions**
73
+ > String edit_pdf_set_permissions(owner_password, input_file, opts)
74
+
75
+ Encrypt, password-protect and set restricted permissions on a PDF
76
+
77
+ 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).
78
+
79
+ ### Example
80
+ ```ruby
81
+ # load the gem
82
+ require 'cloudmersive-convert-api-client'
83
+ # setup authorization
84
+ CloudmersiveConvertApiClient.configure do |config|
85
+ # Configure API key authorization: Apikey
86
+ config.api_key['Apikey'] = 'YOUR API KEY'
87
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
88
+ #config.api_key_prefix['Apikey'] = 'Bearer'
89
+ end
90
+
91
+ api_instance = CloudmersiveConvertApiClient::EditPdfApi.new
92
+
93
+ owner_password = "owner_password_example" # String | Password of a owner (creator/editor) of the PDF file (required)
94
+
95
+ input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
96
+
97
+ opts = {
98
+ user_password: "user_password_example", # String | Password of a user (reader) of the PDF file (optional)
99
+ allow_printing: true, # BOOLEAN | Set to false to disable printing through DRM. Default is true.
100
+ allow_document_assembly: true, # BOOLEAN | Set to false to disable document assembly through DRM. Default is true.
101
+ allow_content_extraction: true, # BOOLEAN | Set to false to disable copying/extracting content out of the PDF through DRM. Default is true.
102
+ allow_form_filling: true, # BOOLEAN | Set to false to disable filling out form fields in the PDF through DRM. Default is true.
103
+ allow_editing: true, # BOOLEAN | Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true.
104
+ allow_annotations: true, # BOOLEAN | Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true.
105
+ allow_degraded_printing: true # BOOLEAN | Set to false to disable degraded printing of the PDF through DRM. Default is true.
106
+ }
107
+
108
+ begin
109
+ #Encrypt, password-protect and set restricted permissions on a PDF
110
+ result = api_instance.edit_pdf_set_permissions(owner_password, input_file, opts)
111
+ p result
112
+ rescue CloudmersiveConvertApiClient::ApiError => e
113
+ puts "Exception when calling EditPdfApi->edit_pdf_set_permissions: #{e}"
114
+ end
115
+ ```
116
+
117
+ ### Parameters
118
+
119
+ Name | Type | Description | Notes
120
+ ------------- | ------------- | ------------- | -------------
121
+ **owner_password** | **String**| Password of a owner (creator/editor) of the PDF file (required) |
122
+ **input_file** | **File**| Input file to perform the operation on. |
123
+ **user_password** | **String**| Password of a user (reader) of the PDF file (optional) | [optional]
124
+ **allow_printing** | **BOOLEAN**| Set to false to disable printing through DRM. Default is true. | [optional]
125
+ **allow_document_assembly** | **BOOLEAN**| Set to false to disable document assembly through DRM. Default is true. | [optional]
126
+ **allow_content_extraction** | **BOOLEAN**| Set to false to disable copying/extracting content out of the PDF through DRM. Default is true. | [optional]
127
+ **allow_form_filling** | **BOOLEAN**| Set to false to disable filling out form fields in the PDF through DRM. Default is true. | [optional]
128
+ **allow_editing** | **BOOLEAN**| Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true. | [optional]
129
+ **allow_annotations** | **BOOLEAN**| Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true. | [optional]
130
+ **allow_degraded_printing** | **BOOLEAN**| Set to false to disable degraded printing of the PDF through DRM. Default is true. | [optional]
131
+
132
+ ### Return type
133
+
134
+ **String**
135
+
136
+ ### Authorization
137
+
138
+ [Apikey](../README.md#Apikey)
139
+
140
+ ### HTTP request headers
141
+
142
+ - **Content-Type**: multipart/form-data
143
+ - **Accept**: application/octet-stream
144
+
145
+
146
+
147
+ # **edit_pdf_watermark_text**
148
+ > String edit_pdf_watermark_text(watermark_text, input_file, opts)
149
+
150
+ Add a text watermark to a PDF
151
+
152
+ Adds a text watermark to a PDF
153
+
154
+ ### Example
155
+ ```ruby
156
+ # load the gem
157
+ require 'cloudmersive-convert-api-client'
158
+ # setup authorization
159
+ CloudmersiveConvertApiClient.configure do |config|
160
+ # Configure API key authorization: Apikey
161
+ config.api_key['Apikey'] = 'YOUR API KEY'
162
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
163
+ #config.api_key_prefix['Apikey'] = 'Bearer'
164
+ end
165
+
166
+ api_instance = CloudmersiveConvertApiClient::EditPdfApi.new
167
+
168
+ watermark_text = "watermark_text_example" # String | Watermark text to add to the PDF (required)
169
+
170
+ input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
171
+
172
+ opts = {
173
+ font_name: "font_name_example", # String | Font Family Name for the watermark text; default is Times New Roman
174
+ font_size: 8.14, # Float | Font Size in points of the text; default is 150
175
+ font_color: "font_color_example", # String | Font color in hexadecimal or HTML color name; default is Red
176
+ font_transparency: 8.14 # Float | Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5
177
+ }
178
+
179
+ begin
180
+ #Add a text watermark to a PDF
181
+ result = api_instance.edit_pdf_watermark_text(watermark_text, input_file, opts)
182
+ p result
183
+ rescue CloudmersiveConvertApiClient::ApiError => e
184
+ puts "Exception when calling EditPdfApi->edit_pdf_watermark_text: #{e}"
185
+ end
186
+ ```
187
+
188
+ ### Parameters
189
+
190
+ Name | Type | Description | Notes
191
+ ------------- | ------------- | ------------- | -------------
192
+ **watermark_text** | **String**| Watermark text to add to the PDF (required) |
193
+ **input_file** | **File**| Input file to perform the operation on. |
194
+ **font_name** | **String**| Font Family Name for the watermark text; default is Times New Roman | [optional]
195
+ **font_size** | **Float**| Font Size in points of the text; default is 150 | [optional]
196
+ **font_color** | **String**| Font color in hexadecimal or HTML color name; default is Red | [optional]
197
+ **font_transparency** | **Float**| Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5 | [optional]
198
+
199
+ ### Return type
200
+
201
+ **String**
202
+
203
+ ### Authorization
204
+
205
+ [Apikey](../README.md#Apikey)
206
+
207
+ ### HTTP request headers
208
+
209
+ - **Content-Type**: multipart/form-data
210
+ - **Accept**: application/octet-stream
211
+
212
+
213
+
@@ -109,6 +109,7 @@ require 'cloudmersive-convert-api-client/api/convert_image_api'
109
109
  require 'cloudmersive-convert-api-client/api/convert_template_api'
110
110
  require 'cloudmersive-convert-api-client/api/convert_web_api'
111
111
  require 'cloudmersive-convert-api-client/api/edit_document_api'
112
+ require 'cloudmersive-convert-api-client/api/edit_pdf_api'
112
113
  require 'cloudmersive-convert-api-client/api/merge_document_api'
113
114
  require 'cloudmersive-convert-api-client/api/split_document_api'
114
115
  require 'cloudmersive-convert-api-client/api/validate_document_api'
@@ -0,0 +1,247 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module CloudmersiveConvertApiClient
16
+ class EditPdfApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Encrypt and password-protect a PDF
24
+ # 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.
25
+ # @param input_file Input file to perform the operation on.
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :user_password Password of a user (reader) of the PDF file
28
+ # @option opts [String] :owner_password Password of a owner (creator/editor) of the PDF file
29
+ # @return [String]
30
+ def edit_pdf_encrypt(input_file, opts = {})
31
+ data, _status_code, _headers = edit_pdf_encrypt_with_http_info(input_file, opts)
32
+ return data
33
+ end
34
+
35
+ # Encrypt and password-protect a PDF
36
+ # 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.
37
+ # @param input_file Input file to perform the operation on.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :user_password Password of a user (reader) of the PDF file
40
+ # @option opts [String] :owner_password Password of a owner (creator/editor) of the PDF file
41
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
42
+ def edit_pdf_encrypt_with_http_info(input_file, opts = {})
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug "Calling API: EditPdfApi.edit_pdf_encrypt ..."
45
+ end
46
+ # verify the required parameter 'input_file' is set
47
+ if @api_client.config.client_side_validation && input_file.nil?
48
+ fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_encrypt"
49
+ end
50
+ # resource path
51
+ local_var_path = "/convert/edit/pdf/encrypt"
52
+
53
+ # query parameters
54
+ query_params = {}
55
+
56
+ # header parameters
57
+ header_params = {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
60
+ # HTTP header 'Content-Type'
61
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
62
+ header_params[:'userPassword'] = opts[:'user_password'] if !opts[:'user_password'].nil?
63
+ header_params[:'ownerPassword'] = opts[:'owner_password'] if !opts[:'owner_password'].nil?
64
+
65
+ # form parameters
66
+ form_params = {}
67
+ form_params["inputFile"] = input_file
68
+
69
+ # http body (model)
70
+ post_body = nil
71
+ auth_names = ['Apikey']
72
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => 'String')
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: EditPdfApi#edit_pdf_encrypt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Encrypt, password-protect and set restricted permissions on a PDF
86
+ # 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).
87
+ # @param owner_password Password of a owner (creator/editor) of the PDF file (required)
88
+ # @param input_file Input file to perform the operation on.
89
+ # @param [Hash] opts the optional parameters
90
+ # @option opts [String] :user_password Password of a user (reader) of the PDF file (optional)
91
+ # @option opts [BOOLEAN] :allow_printing Set to false to disable printing through DRM. Default is true.
92
+ # @option opts [BOOLEAN] :allow_document_assembly Set to false to disable document assembly through DRM. Default is true.
93
+ # @option opts [BOOLEAN] :allow_content_extraction Set to false to disable copying/extracting content out of the PDF through DRM. Default is true.
94
+ # @option opts [BOOLEAN] :allow_form_filling Set to false to disable filling out form fields in the PDF through DRM. Default is true.
95
+ # @option opts [BOOLEAN] :allow_editing Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true.
96
+ # @option opts [BOOLEAN] :allow_annotations Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true.
97
+ # @option opts [BOOLEAN] :allow_degraded_printing Set to false to disable degraded printing of the PDF through DRM. Default is true.
98
+ # @return [String]
99
+ def edit_pdf_set_permissions(owner_password, input_file, opts = {})
100
+ data, _status_code, _headers = edit_pdf_set_permissions_with_http_info(owner_password, input_file, opts)
101
+ return data
102
+ end
103
+
104
+ # Encrypt, password-protect and set restricted permissions on a PDF
105
+ # 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).
106
+ # @param owner_password Password of a owner (creator/editor) of the PDF file (required)
107
+ # @param input_file Input file to perform the operation on.
108
+ # @param [Hash] opts the optional parameters
109
+ # @option opts [String] :user_password Password of a user (reader) of the PDF file (optional)
110
+ # @option opts [BOOLEAN] :allow_printing Set to false to disable printing through DRM. Default is true.
111
+ # @option opts [BOOLEAN] :allow_document_assembly Set to false to disable document assembly through DRM. Default is true.
112
+ # @option opts [BOOLEAN] :allow_content_extraction Set to false to disable copying/extracting content out of the PDF through DRM. Default is true.
113
+ # @option opts [BOOLEAN] :allow_form_filling Set to false to disable filling out form fields in the PDF through DRM. Default is true.
114
+ # @option opts [BOOLEAN] :allow_editing Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true.
115
+ # @option opts [BOOLEAN] :allow_annotations Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true.
116
+ # @option opts [BOOLEAN] :allow_degraded_printing Set to false to disable degraded printing of the PDF through DRM. Default is true.
117
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
118
+ def edit_pdf_set_permissions_with_http_info(owner_password, input_file, opts = {})
119
+ if @api_client.config.debugging
120
+ @api_client.config.logger.debug "Calling API: EditPdfApi.edit_pdf_set_permissions ..."
121
+ end
122
+ # verify the required parameter 'owner_password' is set
123
+ if @api_client.config.client_side_validation && owner_password.nil?
124
+ fail ArgumentError, "Missing the required parameter 'owner_password' when calling EditPdfApi.edit_pdf_set_permissions"
125
+ end
126
+ # verify the required parameter 'input_file' is set
127
+ if @api_client.config.client_side_validation && input_file.nil?
128
+ fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_set_permissions"
129
+ end
130
+ # resource path
131
+ local_var_path = "/convert/edit/pdf/encrypt/set-permissions"
132
+
133
+ # query parameters
134
+ query_params = {}
135
+
136
+ # header parameters
137
+ header_params = {}
138
+ # HTTP header 'Accept' (if needed)
139
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
140
+ # HTTP header 'Content-Type'
141
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
142
+ header_params[:'ownerPassword'] = owner_password
143
+ header_params[:'userPassword'] = opts[:'user_password'] if !opts[:'user_password'].nil?
144
+ header_params[:'allowPrinting'] = opts[:'allow_printing'] if !opts[:'allow_printing'].nil?
145
+ header_params[:'allowDocumentAssembly'] = opts[:'allow_document_assembly'] if !opts[:'allow_document_assembly'].nil?
146
+ header_params[:'allowContentExtraction'] = opts[:'allow_content_extraction'] if !opts[:'allow_content_extraction'].nil?
147
+ header_params[:'allowFormFilling'] = opts[:'allow_form_filling'] if !opts[:'allow_form_filling'].nil?
148
+ header_params[:'allowEditing'] = opts[:'allow_editing'] if !opts[:'allow_editing'].nil?
149
+ header_params[:'allowAnnotations'] = opts[:'allow_annotations'] if !opts[:'allow_annotations'].nil?
150
+ header_params[:'allowDegradedPrinting'] = opts[:'allow_degraded_printing'] if !opts[:'allow_degraded_printing'].nil?
151
+
152
+ # form parameters
153
+ form_params = {}
154
+ form_params["inputFile"] = input_file
155
+
156
+ # http body (model)
157
+ post_body = nil
158
+ auth_names = ['Apikey']
159
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
160
+ :header_params => header_params,
161
+ :query_params => query_params,
162
+ :form_params => form_params,
163
+ :body => post_body,
164
+ :auth_names => auth_names,
165
+ :return_type => 'String')
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug "API called: EditPdfApi#edit_pdf_set_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
168
+ end
169
+ return data, status_code, headers
170
+ end
171
+
172
+ # Add a text watermark to a PDF
173
+ # Adds a text watermark to a PDF
174
+ # @param watermark_text Watermark text to add to the PDF (required)
175
+ # @param input_file Input file to perform the operation on.
176
+ # @param [Hash] opts the optional parameters
177
+ # @option opts [String] :font_name Font Family Name for the watermark text; default is Times New Roman
178
+ # @option opts [Float] :font_size Font Size in points of the text; default is 150
179
+ # @option opts [String] :font_color Font color in hexadecimal or HTML color name; default is Red
180
+ # @option opts [Float] :font_transparency Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5
181
+ # @return [String]
182
+ def edit_pdf_watermark_text(watermark_text, input_file, opts = {})
183
+ data, _status_code, _headers = edit_pdf_watermark_text_with_http_info(watermark_text, input_file, opts)
184
+ return data
185
+ end
186
+
187
+ # Add a text watermark to a PDF
188
+ # Adds a text watermark to a PDF
189
+ # @param watermark_text Watermark text to add to the PDF (required)
190
+ # @param input_file Input file to perform the operation on.
191
+ # @param [Hash] opts the optional parameters
192
+ # @option opts [String] :font_name Font Family Name for the watermark text; default is Times New Roman
193
+ # @option opts [Float] :font_size Font Size in points of the text; default is 150
194
+ # @option opts [String] :font_color Font color in hexadecimal or HTML color name; default is Red
195
+ # @option opts [Float] :font_transparency Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5
196
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
197
+ def edit_pdf_watermark_text_with_http_info(watermark_text, input_file, opts = {})
198
+ if @api_client.config.debugging
199
+ @api_client.config.logger.debug "Calling API: EditPdfApi.edit_pdf_watermark_text ..."
200
+ end
201
+ # verify the required parameter 'watermark_text' is set
202
+ if @api_client.config.client_side_validation && watermark_text.nil?
203
+ fail ArgumentError, "Missing the required parameter 'watermark_text' when calling EditPdfApi.edit_pdf_watermark_text"
204
+ end
205
+ # verify the required parameter 'input_file' is set
206
+ if @api_client.config.client_side_validation && input_file.nil?
207
+ fail ArgumentError, "Missing the required parameter 'input_file' when calling EditPdfApi.edit_pdf_watermark_text"
208
+ end
209
+ # resource path
210
+ local_var_path = "/convert/edit/pdf/watermark/text"
211
+
212
+ # query parameters
213
+ query_params = {}
214
+
215
+ # header parameters
216
+ header_params = {}
217
+ # HTTP header 'Accept' (if needed)
218
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
219
+ # HTTP header 'Content-Type'
220
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
221
+ header_params[:'watermarkText'] = watermark_text
222
+ header_params[:'fontName'] = opts[:'font_name'] if !opts[:'font_name'].nil?
223
+ header_params[:'fontSize'] = opts[:'font_size'] if !opts[:'font_size'].nil?
224
+ header_params[:'fontColor'] = opts[:'font_color'] if !opts[:'font_color'].nil?
225
+ header_params[:'fontTransparency'] = opts[:'font_transparency'] if !opts[:'font_transparency'].nil?
226
+
227
+ # form parameters
228
+ form_params = {}
229
+ form_params["inputFile"] = input_file
230
+
231
+ # http body (model)
232
+ post_body = nil
233
+ auth_names = ['Apikey']
234
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
235
+ :header_params => header_params,
236
+ :query_params => query_params,
237
+ :form_params => form_params,
238
+ :body => post_body,
239
+ :auth_names => auth_names,
240
+ :return_type => 'String')
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug "API called: EditPdfApi#edit_pdf_watermark_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
+ end
244
+ return data, status_code, headers
245
+ end
246
+ end
247
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.3.1
11
11
  =end
12
12
 
13
13
  module CloudmersiveConvertApiClient
14
- VERSION = "1.4.5"
14
+ VERSION = "1.4.6"
15
15
  end
@@ -0,0 +1,87 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for CloudmersiveConvertApiClient::EditPdfApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'EditPdfApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = CloudmersiveConvertApiClient::EditPdfApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of EditPdfApi' do
30
+ it 'should create an instance of EditPdfApi' do
31
+ expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::EditPdfApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for edit_pdf_encrypt
36
+ # Encrypt and password-protect a PDF
37
+ # 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.
38
+ # @param input_file Input file to perform the operation on.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :user_password Password of a user (reader) of the PDF file
41
+ # @option opts [String] :owner_password Password of a owner (creator/editor) of the PDF file
42
+ # @return [String]
43
+ describe 'edit_pdf_encrypt test' do
44
+ it "should work" do
45
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
46
+ end
47
+ end
48
+
49
+ # unit tests for edit_pdf_set_permissions
50
+ # Encrypt, password-protect and set restricted permissions on a PDF
51
+ # 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).
52
+ # @param owner_password Password of a owner (creator/editor) of the PDF file (required)
53
+ # @param input_file Input file to perform the operation on.
54
+ # @param [Hash] opts the optional parameters
55
+ # @option opts [String] :user_password Password of a user (reader) of the PDF file (optional)
56
+ # @option opts [BOOLEAN] :allow_printing Set to false to disable printing through DRM. Default is true.
57
+ # @option opts [BOOLEAN] :allow_document_assembly Set to false to disable document assembly through DRM. Default is true.
58
+ # @option opts [BOOLEAN] :allow_content_extraction Set to false to disable copying/extracting content out of the PDF through DRM. Default is true.
59
+ # @option opts [BOOLEAN] :allow_form_filling Set to false to disable filling out form fields in the PDF through DRM. Default is true.
60
+ # @option opts [BOOLEAN] :allow_editing Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true.
61
+ # @option opts [BOOLEAN] :allow_annotations Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true.
62
+ # @option opts [BOOLEAN] :allow_degraded_printing Set to false to disable degraded printing of the PDF through DRM. Default is true.
63
+ # @return [String]
64
+ describe 'edit_pdf_set_permissions test' do
65
+ it "should work" do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ # unit tests for edit_pdf_watermark_text
71
+ # Add a text watermark to a PDF
72
+ # Adds a text watermark to a PDF
73
+ # @param watermark_text Watermark text to add to the PDF (required)
74
+ # @param input_file Input file to perform the operation on.
75
+ # @param [Hash] opts the optional parameters
76
+ # @option opts [String] :font_name Font Family Name for the watermark text; default is Times New Roman
77
+ # @option opts [Float] :font_size Font Size in points of the text; default is 150
78
+ # @option opts [String] :font_color Font color in hexadecimal or HTML color name; default is Red
79
+ # @option opts [Float] :font_transparency Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5
80
+ # @return [String]
81
+ describe 'edit_pdf_watermark_text test' do
82
+ it "should work" do
83
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
84
+ end
85
+ end
86
+
87
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-convert-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-27 00:00:00.000000000 Z
11
+ date: 2019-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -239,6 +239,7 @@ files:
239
239
  - "./docs/DocxTemplateOperation.md"
240
240
  - "./docs/DocxText.md"
241
241
  - "./docs/EditDocumentApi.md"
242
+ - "./docs/EditPdfApi.md"
242
243
  - "./docs/ExifValue.md"
243
244
  - "./docs/FinishEditingRequest.md"
244
245
  - "./docs/GetDocxBodyRequest.md"
@@ -305,6 +306,7 @@ files:
305
306
  - "./lib/cloudmersive-convert-api-client/api/convert_template_api.rb"
306
307
  - "./lib/cloudmersive-convert-api-client/api/convert_web_api.rb"
307
308
  - "./lib/cloudmersive-convert-api-client/api/edit_document_api.rb"
309
+ - "./lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb"
308
310
  - "./lib/cloudmersive-convert-api-client/api/merge_document_api.rb"
309
311
  - "./lib/cloudmersive-convert-api-client/api/split_document_api.rb"
310
312
  - "./lib/cloudmersive-convert-api-client/api/validate_document_api.rb"
@@ -403,6 +405,7 @@ files:
403
405
  - "./spec/api/convert_template_api_spec.rb"
404
406
  - "./spec/api/convert_web_api_spec.rb"
405
407
  - "./spec/api/edit_document_api_spec.rb"
408
+ - "./spec/api/edit_pdf_api_spec.rb"
406
409
  - "./spec/api/merge_document_api_spec.rb"
407
410
  - "./spec/api/split_document_api_spec.rb"
408
411
  - "./spec/api/validate_document_api_spec.rb"