Class: CloudmersiveConvertApiClient::EditPdfApi
- Inherits:
-
Object
- Object
- CloudmersiveConvertApiClient::EditPdfApi
- Defined in:
- lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#edit_pdf_encrypt(input_file, opts = {}) ⇒ String
Encrypt and password-protect a PDF Encrypt a PDF document with a password.
-
#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.
-
#edit_pdf_set_permissions(owner_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.
-
#edit_pdf_set_permissions_with_http_info(owner_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.
-
#edit_pdf_watermark_text(watermark_text, input_file, opts = {}) ⇒ String
Add a text watermark to a PDF Adds a text watermark to a PDF.
-
#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.
-
#initialize(api_client = ApiClient.default) ⇒ EditPdfApi
constructor
A new instance of EditPdfApi.
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_client ⇒ Object
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_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.
30 31 32 33 |
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 30 def edit_pdf_encrypt(input_file, opts = {}) data, _status_code, _headers = edit_pdf_encrypt_with_http_info(input_file, opts) return data end |
#edit_pdf_encrypt_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Encrypt and password-protect a PDF Encrypt a PDF document with a password. Set an owner password to control owner (editor/creator) permissions, and set a user (reader) password to control the viewer of the PDF. Set the password fields null to omit the given password.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 42 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? # 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_set_permissions(owner_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).
99 100 101 102 |
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 99 def (owner_password, input_file, opts = {}) data, _status_code, _headers = (owner_password, input_file, opts) return data end |
#edit_pdf_set_permissions_with_http_info(owner_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).
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 118 def (owner_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 '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'] = opts[:'user_password'] if !opts[:'user_password'].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
182 183 184 185 |
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 182 def edit_pdf_watermark_text(watermark_text, input_file, opts = {}) data, _status_code, _headers = edit_pdf_watermark_text_with_http_info(watermark_text, input_file, opts) return data end |
#edit_pdf_watermark_text_with_http_info(watermark_text, input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Add a text watermark to a PDF Adds a text watermark to a PDF
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 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 |
# File 'lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb', line 197 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 |