Class: GroupDocsViewerCloud::RenderOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/groupdocs_viewer_cloud/models/render_options.rb

Overview

Rendering options

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RenderOptions

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
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
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 158

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.key?(:'StartPageNumber')
    self.start_page_number = attributes[:'StartPageNumber']
  end

  if attributes.key?(:'CountPagesToRender')
    self.count_pages_to_render = attributes[:'CountPagesToRender']
  end

  if attributes.key?(:'PagesToRender')
    if (value = attributes[:'PagesToRender']).is_a?(Array)
      self.pages_to_render = value
    end
  end

  if attributes.key?(:'PageRotations')
    if (value = attributes[:'PageRotations']).is_a?(Array)
      self.page_rotations = value
    end
  end

  if attributes.key?(:'DefaultFontName')
    self.default_font_name = attributes[:'DefaultFontName']
  end

  if attributes.key?(:'DefaultEncoding')
    self.default_encoding = attributes[:'DefaultEncoding']
  end

  if attributes.key?(:'DetectEncoding')
    self.detect_encoding = attributes[:'DetectEncoding']
  end

  if attributes.key?(:'RenderComments')
    self.render_comments = attributes[:'RenderComments']
  end

  if attributes.key?(:'RenderNotes')
    self.render_notes = attributes[:'RenderNotes']
  end

  if attributes.key?(:'RenderHiddenPages')
    self.render_hidden_pages = attributes[:'RenderHiddenPages']
  end

  if attributes.key?(:'SpreadsheetOptions')
    self.spreadsheet_options = attributes[:'SpreadsheetOptions']
  end

  if attributes.key?(:'CadOptions')
    self.cad_options = attributes[:'CadOptions']
  end

  if attributes.key?(:'EmailOptions')
    self.email_options = attributes[:'EmailOptions']
  end

  if attributes.key?(:'ProjectManagementOptions')
    self.project_management_options = attributes[:'ProjectManagementOptions']
  end

  if attributes.key?(:'PdfDocumentOptions')
    self.pdf_document_options = attributes[:'PdfDocumentOptions']
  end

  if attributes.key?(:'WordProcessingOptions')
    self.word_processing_options = attributes[:'WordProcessingOptions']
  end

  if attributes.key?(:'OutlookOptions')
    self.outlook_options = attributes[:'OutlookOptions']
  end

  if attributes.key?(:'ArchiveOptions')
    self.archive_options = attributes[:'ArchiveOptions']
  end

  if attributes.key?(:'TextOptions')
    self.text_options = attributes[:'TextOptions']
  end

  if attributes.key?(:'MailStorageOptions')
    self.mail_storage_options = attributes[:'MailStorageOptions']
  end

  if attributes.key?(:'VisioRenderingOptions')
    self.visio_rendering_options = attributes[:'VisioRenderingOptions']
  end

  if attributes.key?(:'WebDocumentOptions')
    self.web_document_options = attributes[:'WebDocumentOptions']
  end

end

Instance Attribute Details

#archive_optionsObject

Rendering options for Archive source file formats



86
87
88
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 86

def archive_options
  @archive_options
end

#cad_optionsObject

Rendering options for CAD source file formats CAD file formats include files with extensions: .dwg, .dxf, .dgn, .ifc, .stl



68
69
70
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 68

def cad_options
  @cad_options
end

#count_pages_to_renderObject

Count pages which should be rendered



38
39
40
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 38

def count_pages_to_render
  @count_pages_to_render
end

#default_encodingObject

Default encoding for the plain text files such as .csv, .txt and .eml files when encoding is not specified in header



50
51
52
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 50

def default_encoding
  @default_encoding
end

#default_font_nameObject

Default font name may be specified in following cases: - You want to generally specify the default font to fall back on, if particular font in the document cannot be found during rendering. - Your document uses fonts, that contain non-English characters and you want to make sure any missing font is replaced with one that has the same character set available.



47
48
49
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 47

def default_font_name
  @default_font_name
end

#detect_encodingObject

This option enables TXT, TSV, and CSV files encoding detection. In case the encoding can’t be detected the DefaultEncoding is used.



53
54
55
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 53

def detect_encoding
  @detect_encoding
end

#email_optionsObject

Rendering options for Email source file formats Email file formats include files with extensions: .msg, .eml, .emlx, .ifc, .stl



71
72
73
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 71

def email_options
  @email_options
end

#mail_storage_optionsObject

Rendering options for Mail storage (Lotus Notes, MBox) data files.



92
93
94
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 92

def mail_storage_options
  @mail_storage_options
end

#outlook_optionsObject

Rendering options for Outlook source file formats



83
84
85
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 83

def outlook_options
  @outlook_options
end

#page_rotationsObject

Page rotations



44
45
46
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 44

def page_rotations
  @page_rotations
end

#pages_to_renderObject

Pages list to render. Ignored, if StartPageNumber and CountPagesToRender are provided



41
42
43
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 41

def pages_to_render
  @pages_to_render
end

#pdf_document_optionsObject

Rendering options for PDF source file formats



77
78
79
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 77

def pdf_document_options
  @pdf_document_options
end

#project_management_optionsObject

Rendering options for MS Project source file formats Project file formats include files with extensions: .mpt, .mpp



74
75
76
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 74

def project_management_options
  @project_management_options
end

#render_commentsObject

When enabled comments will be rendered to the output



56
57
58
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 56

def render_comments
  @render_comments
end

#render_hidden_pagesObject

When enabled hidden pages, sheets or slides will be rendered to the output



62
63
64
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 62

def render_hidden_pages
  @render_hidden_pages
end

#render_notesObject

When enabled notes will be rendered to the output



59
60
61
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 59

def render_notes
  @render_notes
end

#spreadsheet_optionsObject

Rendering options for Spreadsheet source file formats Spreadsheet file formats include files with extensions: .xls, .xlsx, .xlsm, .xlsb, .csv, .ods, .ots, .xltx, .xltm, .tsv



65
66
67
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 65

def spreadsheet_options
  @spreadsheet_options
end

#start_page_numberObject

Page number from which rendering should be started



35
36
37
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 35

def start_page_number
  @start_page_number
end

#text_optionsObject

Rendering options for Text source file formats



89
90
91
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 89

def text_options
  @text_options
end

#visio_rendering_optionsObject

Rendering options for Visio source file formats



95
96
97
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 95

def visio_rendering_options
  @visio_rendering_options
end

#web_document_optionsObject

This rendering options enables you to customize the appearance of the output HTML/PDF/PNG/JPEG when rendering Web documents.



98
99
100
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 98

def web_document_options
  @web_document_options
end

#word_processing_optionsObject

Rendering options for WordProcessing source file formats



80
81
82
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 80

def word_processing_options
  @word_processing_options
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 101

def self.attribute_map
  {
    :'start_page_number' => :'StartPageNumber',
    :'count_pages_to_render' => :'CountPagesToRender',
    :'pages_to_render' => :'PagesToRender',
    :'page_rotations' => :'PageRotations',
    :'default_font_name' => :'DefaultFontName',
    :'default_encoding' => :'DefaultEncoding',
    :'detect_encoding' => :'DetectEncoding',
    :'render_comments' => :'RenderComments',
    :'render_notes' => :'RenderNotes',
    :'render_hidden_pages' => :'RenderHiddenPages',
    :'spreadsheet_options' => :'SpreadsheetOptions',
    :'cad_options' => :'CadOptions',
    :'email_options' => :'EmailOptions',
    :'project_management_options' => :'ProjectManagementOptions',
    :'pdf_document_options' => :'PdfDocumentOptions',
    :'word_processing_options' => :'WordProcessingOptions',
    :'outlook_options' => :'OutlookOptions',
    :'archive_options' => :'ArchiveOptions',
    :'text_options' => :'TextOptions',
    :'mail_storage_options' => :'MailStorageOptions',
    :'visio_rendering_options' => :'VisioRenderingOptions',
    :'web_document_options' => :'WebDocumentOptions'
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 129

def self.swagger_types
  {
    :'start_page_number' => :'Integer',
    :'count_pages_to_render' => :'Integer',
    :'pages_to_render' => :'Array<Integer>',
    :'page_rotations' => :'Array<PageRotation>',
    :'default_font_name' => :'String',
    :'default_encoding' => :'String',
    :'detect_encoding' => :'BOOLEAN',
    :'render_comments' => :'BOOLEAN',
    :'render_notes' => :'BOOLEAN',
    :'render_hidden_pages' => :'BOOLEAN',
    :'spreadsheet_options' => :'SpreadsheetOptions',
    :'cad_options' => :'CadOptions',
    :'email_options' => :'EmailOptions',
    :'project_management_options' => :'ProjectManagementOptions',
    :'pdf_document_options' => :'PdfDocumentOptions',
    :'word_processing_options' => :'WordProcessingOptions',
    :'outlook_options' => :'OutlookOptions',
    :'archive_options' => :'ArchiveOptions',
    :'text_options' => :'TextOptions',
    :'mail_storage_options' => :'MailStorageOptions',
    :'visio_rendering_options' => :'VisioRenderingOptions',
    :'web_document_options' => :'WebDocumentOptions'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 298

def ==(other)
  return true if self.equal?(other)
  self.class == other.class &&
      start_page_number == other.start_page_number &&
      count_pages_to_render == other.count_pages_to_render &&
      pages_to_render == other.pages_to_render &&
      page_rotations == other.page_rotations &&
      default_font_name == other.default_font_name &&
      default_encoding == other.default_encoding &&
      detect_encoding == other.detect_encoding &&
      render_comments == other.render_comments &&
      render_notes == other.render_notes &&
      render_hidden_pages == other.render_hidden_pages &&
      spreadsheet_options == other.spreadsheet_options &&
      cad_options == other.cad_options &&
      email_options == other.email_options &&
      project_management_options == other.project_management_options &&
      pdf_document_options == other.pdf_document_options &&
      word_processing_options == other.word_processing_options &&
      outlook_options == other.outlook_options &&
      archive_options == other.archive_options &&
      text_options == other.text_options &&
      mail_storage_options == other.mail_storage_options &&
      visio_rendering_options == other.visio_rendering_options &&
      web_document_options == other.web_document_options
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 370

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    Date.parse value
  when :Date
    Date.parse value
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else
  # model
    temp_model = GroupDocsViewerCloud.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 437

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 346

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    pname = uncap(self.class.attribute_map[key]).intern
    value = attributes[pname]
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not                    
      if value.is_a?(Array)
        self.send("#{key}=", value.map { |v| _deserialize($1, v) })
      end
    elsif !value.nil?
      self.send("#{key}=", _deserialize(type, value))
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


327
328
329
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 327

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



333
334
335
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 333

def hash
  [start_page_number, count_pages_to_render, pages_to_render, page_rotations, default_font_name, default_encoding, detect_encoding, render_comments, render_notes, render_hidden_pages, spreadsheet_options, cad_options, email_options, project_management_options, pdf_document_options, word_processing_options, outlook_options, archive_options, text_options, mail_storage_options, visio_rendering_options, web_document_options].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 260

def list_invalid_properties
  invalid_properties = []
  if @start_page_number.nil?
    invalid_properties.push("invalid value for 'start_page_number', start_page_number cannot be nil.")
  end

  if @count_pages_to_render.nil?
    invalid_properties.push("invalid value for 'count_pages_to_render', count_pages_to_render cannot be nil.")
  end

  if @render_comments.nil?
    invalid_properties.push("invalid value for 'render_comments', render_comments cannot be nil.")
  end

  if @render_notes.nil?
    invalid_properties.push("invalid value for 'render_notes', render_notes cannot be nil.")
  end

  if @render_hidden_pages.nil?
    invalid_properties.push("invalid value for 'render_hidden_pages', render_hidden_pages cannot be nil.")
  end

  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



417
418
419
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 417

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



423
424
425
426
427
428
429
430
431
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 423

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



411
412
413
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 411

def to_s
  to_hash.to_s
end

#uncap(str) ⇒ Object

Downcases first letter.

Returns:

  • downcased string



339
340
341
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 339

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

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



287
288
289
290
291
292
293
294
# File 'lib/groupdocs_viewer_cloud/models/render_options.rb', line 287

def valid?
  return false if @start_page_number.nil?
  return false if @count_pages_to_render.nil?
  return false if @render_comments.nil?
  return false if @render_notes.nil?
  return false if @render_hidden_pages.nil?
  return true
end