Class: AsposeWordsCloud::SaveAsTiffOnlineRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb

Overview

Request model for save_as_tiff_online operation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document:, save_options:, load_encoding: nil, password: nil, use_anti_aliasing: nil, use_high_quality_rendering: nil, image_brightness: nil, image_color_mode: nil, image_contrast: nil, numeral_format: nil, page_count: nil, page_index: nil, paper_color: nil, pixel_format: nil, resolution: nil, scale: nil, tiff_compression: nil, dml_rendering_mode: nil, dml_effects_rendering_mode: nil, tiff_binarization_method: nil, zip_output: nil, fonts_location: nil) ⇒ SaveAsTiffOnlineRequest

Initializes a new instance.

Parameters:

  • document

    The document.

  • save_options

    Tiff save options.

  • load_encoding (defaults to: nil)

    Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.

  • password (defaults to: nil)

    Password for opening an encrypted document.

  • use_anti_aliasing (defaults to: nil)

    The flag indicating whether to use antialiasing.

  • use_high_quality_rendering (defaults to: nil)

    The flag indicating whether to use high quality.

  • image_brightness (defaults to: nil)

    The level of brightness for the generated images.

  • image_color_mode (defaults to: nil)

    The color mode for the generated images.

  • image_contrast (defaults to: nil)

    The contrast for the generated images.

  • numeral_format (defaults to: nil)

    The images numeral format.

  • page_count (defaults to: nil)

    The number of pages to render.

  • page_index (defaults to: nil)

    The index of the page to start rendering.

  • paper_color (defaults to: nil)

    The background image color.

  • pixel_format (defaults to: nil)

    The pixel format of the generated images.

  • resolution (defaults to: nil)

    The resolution of the generated images.

  • scale (defaults to: nil)

    The zoom factor for the generated images.

  • tiff_compression (defaults to: nil)

    The compression tipe.

  • dml_rendering_mode (defaults to: nil)

    The optional dml rendering mode. The default value is Fallback.

  • dml_effects_rendering_mode (defaults to: nil)

    The optional dml effects rendering mode. The default value is Simplified.

  • tiff_binarization_method (defaults to: nil)

    The optional TIFF binarization method. Possible values are: FloydSteinbergDithering, Threshold.

  • zip_output (defaults to: nil)

    The flag indicating whether to ZIP the output.

  • fonts_location (defaults to: nil)

    Folder in filestorage with custom fonts.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 123

def initialize(document:, save_options:, load_encoding: nil, password: nil, use_anti_aliasing: nil, use_high_quality_rendering: nil, image_brightness: nil, image_color_mode: nil, image_contrast: nil, numeral_format: nil, page_count: nil, page_index: nil, paper_color: nil, pixel_format: nil, resolution: nil, scale: nil, tiff_compression: nil, dml_rendering_mode: nil, dml_effects_rendering_mode: nil, tiff_binarization_method: nil, zip_output: nil, fonts_location: nil)
  self.document = document
  self.save_options = save_options
  self.load_encoding = load_encoding
  self.password = password
  self.use_anti_aliasing = use_anti_aliasing
  self.use_high_quality_rendering = use_high_quality_rendering
  self.image_brightness = image_brightness
  self.image_color_mode = image_color_mode
  self.image_contrast = image_contrast
  self.numeral_format = numeral_format
  self.page_count = page_count
  self.page_index = page_index
  self.paper_color = paper_color
  self.pixel_format = pixel_format
  self.resolution = resolution
  self.scale = scale
  self.tiff_compression = tiff_compression
  self.dml_rendering_mode = dml_rendering_mode
  self.dml_effects_rendering_mode = dml_effects_rendering_mode
  self.tiff_binarization_method = tiff_binarization_method
  self.zip_output = zip_output
  self.fonts_location = fonts_location
end

Instance Attribute Details

#dml_effects_rendering_modeObject

The optional dml effects rendering mode. The default value is Simplified.



87
88
89
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 87

def dml_effects_rendering_mode
  @dml_effects_rendering_mode
end

#dml_rendering_modeObject

The optional dml rendering mode. The default value is Fallback.



84
85
86
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 84

def dml_rendering_mode
  @dml_rendering_mode
end

#documentObject

The document.



33
34
35
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 33

def document
  @document
end

#fonts_locationObject

Folder in filestorage with custom fonts.



96
97
98
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 96

def fonts_location
  @fonts_location
end

#image_brightnessObject

The level of brightness for the generated images.



51
52
53
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 51

def image_brightness
  @image_brightness
end

#image_color_modeObject

The color mode for the generated images.



54
55
56
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 54

def image_color_mode
  @image_color_mode
end

#image_contrastObject

The contrast for the generated images.



57
58
59
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 57

def image_contrast
  @image_contrast
end

#load_encodingObject

Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.



39
40
41
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 39

def load_encoding
  @load_encoding
end

#numeral_formatObject

The images numeral format.



60
61
62
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 60

def numeral_format
  @numeral_format
end

#page_countObject

The number of pages to render.



63
64
65
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 63

def page_count
  @page_count
end

#page_indexObject

The index of the page to start rendering.



66
67
68
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 66

def page_index
  @page_index
end

#paper_colorObject

The background image color.



69
70
71
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 69

def paper_color
  @paper_color
end

#passwordObject

Password for opening an encrypted document.



42
43
44
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 42

def password
  @password
end

#pixel_formatObject

The pixel format of the generated images.



72
73
74
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 72

def pixel_format
  @pixel_format
end

#resolutionObject

The resolution of the generated images.



75
76
77
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 75

def resolution
  @resolution
end

#save_optionsObject

Tiff save options.



36
37
38
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 36

def save_options
  @save_options
end

#scaleObject

The zoom factor for the generated images.



78
79
80
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 78

def scale
  @scale
end

#tiff_binarization_methodObject

The optional TIFF binarization method. Possible values are: FloydSteinbergDithering, Threshold.



90
91
92
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 90

def tiff_binarization_method
  @tiff_binarization_method
end

#tiff_compressionObject

The compression tipe.



81
82
83
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 81

def tiff_compression
  @tiff_compression
end

#use_anti_aliasingObject

The flag indicating whether to use antialiasing.



45
46
47
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 45

def use_anti_aliasing
  @use_anti_aliasing
end

#use_high_quality_renderingObject

The flag indicating whether to use high quality.



48
49
50
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 48

def use_high_quality_rendering
  @use_high_quality_rendering
end

#zip_outputObject

The flag indicating whether to ZIP the output.



93
94
95
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 93

def zip_output
  @zip_output
end

Instance Method Details

#create_http_request(api_client) ⇒ Object

Raises:

  • (ArgumentError)


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
265
266
267
268
269
270
271
272
273
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 219

def create_http_request(api_client)
  # verify the required parameter 'document' is set
  raise ArgumentError, 'Missing the required parameter document when calling WordsApi.save_as_tiff_online' if api_client.config.client_side_validation && self.document.nil?
  # verify the required parameter 'save_options' is set
  raise ArgumentError, 'Missing the required parameter save_options when calling WordsApi.save_as_tiff_online' if api_client.config.client_side_validation && self.save_options.nil?

  # resource path
  local_var_path = '/words/online/put/saveAs/tiff'[1..-1]
  local_var_path = local_var_path.sub('//', '/')

  # query parameters
  query_params = {}
  query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
  query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
  query_params[downcase_first_letter('UseAntiAliasing')] = self.use_anti_aliasing unless self.use_anti_aliasing.nil?
  query_params[downcase_first_letter('UseHighQualityRendering')] = self.use_high_quality_rendering unless self.use_high_quality_rendering.nil?
  query_params[downcase_first_letter('ImageBrightness')] = self.image_brightness unless self.image_brightness.nil?
  query_params[downcase_first_letter('ImageColorMode')] = self.image_color_mode unless self.image_color_mode.nil?
  query_params[downcase_first_letter('ImageContrast')] = self.image_contrast unless self.image_contrast.nil?
  query_params[downcase_first_letter('NumeralFormat')] = self.numeral_format unless self.numeral_format.nil?
  query_params[downcase_first_letter('PageCount')] = self.page_count unless self.page_count.nil?
  query_params[downcase_first_letter('PageIndex')] = self.page_index unless self.page_index.nil?
  query_params[downcase_first_letter('PaperColor')] = self.paper_color unless self.paper_color.nil?
  query_params[downcase_first_letter('PixelFormat')] = self.pixel_format unless self.pixel_format.nil?
  query_params[downcase_first_letter('Resolution')] = self.resolution unless self.resolution.nil?
  query_params[downcase_first_letter('Scale')] = self.scale unless self.scale.nil?
  query_params[downcase_first_letter('TiffCompression')] = self.tiff_compression unless self.tiff_compression.nil?
  query_params[downcase_first_letter('DmlRenderingMode')] = self.dml_rendering_mode unless self.dml_rendering_mode.nil?
  query_params[downcase_first_letter('DmlEffectsRenderingMode')] = self.dml_effects_rendering_mode unless self.dml_effects_rendering_mode.nil?
  query_params[downcase_first_letter('TiffBinarizationMethod')] = self.tiff_binarization_method unless self.tiff_binarization_method.nil?
  query_params[downcase_first_letter('ZipOutput')] = self.zip_output unless self.zip_output.nil?
  query_params[downcase_first_letter('FontsLocation')] = self.fonts_location unless self.fonts_location.nil?

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params[downcase_first_letter('Document')] = self.document
  form_params[downcase_first_letter('SaveOptions')] = self.save_options.to_body.to_json

  # http body (model)
  post_body = nil
  body = api_client.build_request_body(header_params, form_params, post_body)
  {
    'method': :PUT,
    'path': local_var_path,
    'header_params': header_params,
    'query_params': query_params,
    'body': body,
    'auth_names': ['JWT']
  }
end

#downcase_first_letter(str) ⇒ Object

Helper method to convert first letter to downcase



278
279
280
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 278

def downcase_first_letter(str)
  str[0].downcase + str[1..-1]
end

#get_response_typeObject

Get response type



283
284
285
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 283

def get_response_type
  'SaveAsTiffOnlineResponse'
end

#to_batch_part(api_client) ⇒ Object

Creating batch part from request

Raises:

  • (ArgumentError)


149
150
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/aspose_words_cloud/models/requests/save_as_tiff_online_request.rb', line 149

def to_batch_part(api_client)
  # verify the required parameter 'document' is set
  raise ArgumentError, 'Missing the required parameter document when calling WordsApi.save_as_tiff_online' if api_client.config.client_side_validation && self.document.nil?
  # verify the required parameter 'save_options' is set
  raise ArgumentError, 'Missing the required parameter save_options when calling WordsApi.save_as_tiff_online' if api_client.config.client_side_validation && self.save_options.nil?

  # resource path
  local_var_path = '/words/online/put/saveAs/tiff'[7..-1]
  local_var_path = local_var_path.sub('//', '/')

  # query parameters
  query_params = {}
  query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
  query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
  query_params[downcase_first_letter('UseAntiAliasing')] = self.use_anti_aliasing unless self.use_anti_aliasing.nil?
  query_params[downcase_first_letter('UseHighQualityRendering')] = self.use_high_quality_rendering unless self.use_high_quality_rendering.nil?
  query_params[downcase_first_letter('ImageBrightness')] = self.image_brightness unless self.image_brightness.nil?
  query_params[downcase_first_letter('ImageColorMode')] = self.image_color_mode unless self.image_color_mode.nil?
  query_params[downcase_first_letter('ImageContrast')] = self.image_contrast unless self.image_contrast.nil?
  query_params[downcase_first_letter('NumeralFormat')] = self.numeral_format unless self.numeral_format.nil?
  query_params[downcase_first_letter('PageCount')] = self.page_count unless self.page_count.nil?
  query_params[downcase_first_letter('PageIndex')] = self.page_index unless self.page_index.nil?
  query_params[downcase_first_letter('PaperColor')] = self.paper_color unless self.paper_color.nil?
  query_params[downcase_first_letter('PixelFormat')] = self.pixel_format unless self.pixel_format.nil?
  query_params[downcase_first_letter('Resolution')] = self.resolution unless self.resolution.nil?
  query_params[downcase_first_letter('Scale')] = self.scale unless self.scale.nil?
  query_params[downcase_first_letter('TiffCompression')] = self.tiff_compression unless self.tiff_compression.nil?
  query_params[downcase_first_letter('DmlRenderingMode')] = self.dml_rendering_mode unless self.dml_rendering_mode.nil?
  query_params[downcase_first_letter('DmlEffectsRenderingMode')] = self.dml_effects_rendering_mode unless self.dml_effects_rendering_mode.nil?
  query_params[downcase_first_letter('TiffBinarizationMethod')] = self.tiff_binarization_method unless self.tiff_binarization_method.nil?
  query_params[downcase_first_letter('ZipOutput')] = self.zip_output unless self.zip_output.nil?
  query_params[downcase_first_letter('FontsLocation')] = self.fonts_location unless self.fonts_location.nil?

  if query_params
    query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
  end

  header_params = {}
  # header parameters
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params[downcase_first_letter('Document')] = self.document
  form_params[downcase_first_letter('SaveOptions')] = self.save_options.to_body.to_json

  # http body (model)
  post_body = nil
  body = api_client.build_request_body_batch(header_params, form_params, post_body)
  part = ""
  part.concat("PUT".force_encoding('UTF-8'))
  part.concat(" ".force_encoding('UTF-8'))
  part.concat(local_var_path.force_encoding('UTF-8'))
  part.concat(" \r\n".force_encoding('UTF-8'))

  header_params.each_pair {|key, value| part.concat(key.dup.force_encoding('UTF-8') , ": ".force_encoding('UTF-8'), value.dup.force_encoding('UTF-8'), "\r\n".force_encoding('UTF-8')) }
  part.concat("\r\n".force_encoding('UTF-8'))
  if body
    if body.is_a?(Hash)
      body.each do |key, value|
      part.concat(value, "\r\n")
    end
    else
      part.concat(body)
    end
  end
 part
end