Class: AsposeCellsCloud::PageSetup

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_cells_cloud/models/page_setup.rb

Overview

excel print page setting

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PageSetup

Initializes the object



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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 217

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.has_key?(:'link')
    self.link = attributes[:'link']
  end

  if attributes.has_key?(:'IsHFDiffFirst')
    self.is_hf_diff_first = attributes[:'IsHFDiffFirst']
  end

  if attributes.has_key?(:'FitToPagesWide')
    self.fit_to_pages_wide = attributes[:'FitToPagesWide']
  end

  if attributes.has_key?(:'PrintQuality')
    self.print_quality = attributes[:'PrintQuality']
  end

  if attributes.has_key?(:'PrintDraft')
    self.print_draft = attributes[:'PrintDraft']
  end

  if attributes.has_key?(:'FirstPageNumber')
    self.first_page_number = attributes[:'FirstPageNumber']
  end

  if attributes.has_key?(:'PaperSize')
    self.paper_size = attributes[:'PaperSize']
  end

  if attributes.has_key?(:'PrintComments')
    self.print_comments = attributes[:'PrintComments']
  end

  if attributes.has_key?(:'PrintErrors')
    self.print_errors = attributes[:'PrintErrors']
  end

  if attributes.has_key?(:'CenterVertically')
    self.center_vertically = attributes[:'CenterVertically']
  end

  if attributes.has_key?(:'IsPercentScale')
    self.is_percent_scale = attributes[:'IsPercentScale']
  end

  if attributes.has_key?(:'BlackAndWhite')
    self.black_and_white = attributes[:'BlackAndWhite']
  end

  if attributes.has_key?(:'PrintTitleColumns')
    self.print_title_columns = attributes[:'PrintTitleColumns']
  end

  if attributes.has_key?(:'IsHFAlignMargins')
    self.is_hf_align_margins = attributes[:'IsHFAlignMargins']
  end

  if attributes.has_key?(:'PrintArea')
    self.print_area = attributes[:'PrintArea']
  end

  if attributes.has_key?(:'FooterMargin')
    self.footer_margin = attributes[:'FooterMargin']
  end

  if attributes.has_key?(:'LeftMargin')
    self.left_margin = attributes[:'LeftMargin']
  end

  if attributes.has_key?(:'CenterHorizontally')
    self.center_horizontally = attributes[:'CenterHorizontally']
  end

  if attributes.has_key?(:'HeaderMargin')
    self.header_margin = attributes[:'HeaderMargin']
  end

  if attributes.has_key?(:'TopMargin')
    self.top_margin = attributes[:'TopMargin']
  end

  if attributes.has_key?(:'Footer')
    if (value = attributes[:'Footer']).is_a?(Array)
      self.footer = value
    end
  end

  if attributes.has_key?(:'FitToPagesTall')
    self.fit_to_pages_tall = attributes[:'FitToPagesTall']
  end

  if attributes.has_key?(:'IsHFScaleWithDoc')
    self.is_hf_scale_with_doc = attributes[:'IsHFScaleWithDoc']
  end

  if attributes.has_key?(:'PrintHeadings')
    self.print_headings = attributes[:'PrintHeadings']
  end

  if attributes.has_key?(:'Zoom')
    self.zoom = attributes[:'Zoom']
  end

  if attributes.has_key?(:'PrintTitleRows')
    self.print_title_rows = attributes[:'PrintTitleRows']
  end

  if attributes.has_key?(:'Order')
    self.order = attributes[:'Order']
  end

  if attributes.has_key?(:'PrintCopies')
    self.print_copies = attributes[:'PrintCopies']
  end

  if attributes.has_key?(:'Orientation')
    self.orientation = attributes[:'Orientation']
  end

  if attributes.has_key?(:'RightMargin')
    self.right_margin = attributes[:'RightMargin']
  end

  if attributes.has_key?(:'PrintGridlines')
    self.print_gridlines = attributes[:'PrintGridlines']
  end

  if attributes.has_key?(:'IsAutoFirstPageNumber')
    self.is_auto_first_page_number = attributes[:'IsAutoFirstPageNumber']
  end

  if attributes.has_key?(:'Header')
    if (value = attributes[:'Header']).is_a?(Array)
      self.header = value
    end
  end

  if attributes.has_key?(:'IsHFDiffOddEven')
    self.is_hf_diff_odd_even = attributes[:'IsHFDiffOddEven']
  end

  if attributes.has_key?(:'BottomMargin')
    self.bottom_margin = attributes[:'BottomMargin']
  end

end

Instance Attribute Details

#black_and_whiteObject

Represents if elements of the document will be printed in black and white. True/False



61
62
63
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 61

def black_and_white
  @black_and_white
end

#bottom_marginObject

Represents the size of the bottom margin, in unit of centimeters.



130
131
132
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 130

def bottom_margin
  @bottom_margin
end

#center_horizontallyObject

Represent if the sheet is printed centered horizontally.



79
80
81
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 79

def center_horizontally
  @center_horizontally
end

#center_verticallyObject

Represent if the sheet is printed centered vertically.



55
56
57
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 55

def center_vertically
  @center_vertically
end

#first_page_numberObject

Represents the first page number that will be used when this sheet is printed.



43
44
45
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 43

def first_page_number
  @first_page_number
end

#fit_to_pages_tallObject

Represents the number of pages tall the worksheet will be scaled to when it’s printed.



91
92
93
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 91

def fit_to_pages_tall
  @fit_to_pages_tall
end

#fit_to_pages_wideObject

Represents the number of pages wide the worksheet will be scaled to when it’s printed.



34
35
36
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 34

def fit_to_pages_wide
  @fit_to_pages_wide
end

Represents the page footor.



88
89
90
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 88

def footer
  @footer
end

Represents the distance from the bottom of the page to the footer, in unit of centimeters.



73
74
75
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 73

def footer_margin
  @footer_margin
end

#headerObject

Represents the page header.



124
125
126
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 124

def header
  @header
end

#header_marginObject

Represents the distance from the top of the page to the header, in unit of centimeters.



82
83
84
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 82

def header_margin
  @header_margin
end

#is_auto_first_page_numberObject

Indicates whether the first the page number is automatically assigned.



121
122
123
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 121

def is_auto_first_page_number
  @is_auto_first_page_number
end

#is_hf_align_marginsObject

Indicates whether header and footer margins are aligned with the page margins.Only applies for Excel 2007.



67
68
69
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 67

def is_hf_align_margins
  @is_hf_align_margins
end

#is_hf_diff_firstObject

True means that the header/footer of the first page is different with other pages.



31
32
33
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 31

def is_hf_diff_first
  @is_hf_diff_first
end

#is_hf_diff_odd_evenObject

True means that the header/footer of the odd pages is different with odd pages.



127
128
129
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 127

def is_hf_diff_odd_even
  @is_hf_diff_odd_even
end

#is_hf_scale_with_docObject

Indicates whether header and footer are scaled with document scaling.Only applies for Excel 2007.



94
95
96
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 94

def is_hf_scale_with_doc
  @is_hf_scale_with_doc
end

#is_percent_scaleObject

If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.



58
59
60
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 58

def is_percent_scale
  @is_percent_scale
end

#left_marginObject

Represents the size of the left margin, in unit of centimeters.



76
77
78
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 76

def left_margin
  @left_margin
end

Returns the value of attribute link.



28
29
30
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 28

def link
  @link
end

#orderObject

Represents the order that Microsoft Excel uses to number pages when printing a large worksheet.



106
107
108
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 106

def order
  @order
end

#orientationObject

Represents page print orientation.



112
113
114
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 112

def orientation
  @orientation
end

#paper_sizeObject

Represents the size of the paper.



46
47
48
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 46

def paper_size
  @paper_size
end

Represents the range to be printed.



70
71
72
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 70

def print_area
  @print_area
end

Represents the way comments are printed with the sheet.



49
50
51
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 49

def print_comments
  @print_comments
end

Get and sets number of copies to print.



109
110
111
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 109

def print_copies
  @print_copies
end

Represents if the sheet will be printed without graphics.



40
41
42
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 40

def print_draft
  @print_draft
end

Specifies the type of print error displayed.



52
53
54
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 52

def print_errors
  @print_errors
end

Represents if cell gridlines are printed on the page.



118
119
120
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 118

def print_gridlines
  @print_gridlines
end

Represents if row and column headings are printed with this page.



97
98
99
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 97

def print_headings
  @print_headings
end

Represents the print quality.



37
38
39
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 37

def print_quality
  @print_quality
end

Represents the columns that contain the cells to be repeated on the left side of each page.



64
65
66
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 64

def print_title_columns
  @print_title_columns
end

Represents the rows that contain the cells to be repeated at the top of each page.



103
104
105
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 103

def print_title_rows
  @print_title_rows
end

#right_marginObject

Represents the size of the right margin, in unit of centimeters.



115
116
117
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 115

def right_margin
  @right_margin
end

#top_marginObject

Represents the size of the top margin, in unit of centimeters.



85
86
87
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 85

def top_margin
  @top_margin
end

#zoomObject

Represents the scaling factor in percent. It should be between 10 and 400.



100
101
102
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 100

def zoom
  @zoom
end

Class Method Details

.attribute_mapObject

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



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
171
172
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 134

def self.attribute_map
  {
    :'link' => :'link',
    :'is_hf_diff_first' => :'IsHFDiffFirst',
    :'fit_to_pages_wide' => :'FitToPagesWide',
    :'print_quality' => :'PrintQuality',
    :'print_draft' => :'PrintDraft',
    :'first_page_number' => :'FirstPageNumber',
    :'paper_size' => :'PaperSize',
    :'print_comments' => :'PrintComments',
    :'print_errors' => :'PrintErrors',
    :'center_vertically' => :'CenterVertically',
    :'is_percent_scale' => :'IsPercentScale',
    :'black_and_white' => :'BlackAndWhite',
    :'print_title_columns' => :'PrintTitleColumns',
    :'is_hf_align_margins' => :'IsHFAlignMargins',
    :'print_area' => :'PrintArea',
    :'footer_margin' => :'FooterMargin',
    :'left_margin' => :'LeftMargin',
    :'center_horizontally' => :'CenterHorizontally',
    :'header_margin' => :'HeaderMargin',
    :'top_margin' => :'TopMargin',
    :'footer' => :'Footer',
    :'fit_to_pages_tall' => :'FitToPagesTall',
    :'is_hf_scale_with_doc' => :'IsHFScaleWithDoc',
    :'print_headings' => :'PrintHeadings',
    :'zoom' => :'Zoom',
    :'print_title_rows' => :'PrintTitleRows',
    :'order' => :'Order',
    :'print_copies' => :'PrintCopies',
    :'orientation' => :'Orientation',
    :'right_margin' => :'RightMargin',
    :'print_gridlines' => :'PrintGridlines',
    :'is_auto_first_page_number' => :'IsAutoFirstPageNumber',
    :'header' => :'Header',
    :'is_hf_diff_odd_even' => :'IsHFDiffOddEven',
    :'bottom_margin' => :'BottomMargin'
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 175

def self.swagger_types
  {
    :'link' => :'Link',
    :'is_hf_diff_first' => :'BOOLEAN',
    :'fit_to_pages_wide' => :'Integer',
    :'print_quality' => :'Integer',
    :'print_draft' => :'BOOLEAN',
    :'first_page_number' => :'Integer',
    :'paper_size' => :'String',
    :'print_comments' => :'String',
    :'print_errors' => :'String',
    :'center_vertically' => :'BOOLEAN',
    :'is_percent_scale' => :'BOOLEAN',
    :'black_and_white' => :'BOOLEAN',
    :'print_title_columns' => :'String',
    :'is_hf_align_margins' => :'BOOLEAN',
    :'print_area' => :'String',
    :'footer_margin' => :'Float',
    :'left_margin' => :'Float',
    :'center_horizontally' => :'BOOLEAN',
    :'header_margin' => :'Float',
    :'top_margin' => :'Float',
    :'footer' => :'Array<PageSection>',
    :'fit_to_pages_tall' => :'Integer',
    :'is_hf_scale_with_doc' => :'BOOLEAN',
    :'print_headings' => :'BOOLEAN',
    :'zoom' => :'Integer',
    :'print_title_rows' => :'String',
    :'order' => :'String',
    :'print_copies' => :'Integer',
    :'orientation' => :'String',
    :'right_margin' => :'Float',
    :'print_gridlines' => :'BOOLEAN',
    :'is_auto_first_page_number' => :'BOOLEAN',
    :'header' => :'Array<PageSection>',
    :'is_hf_diff_odd_even' => :'BOOLEAN',
    :'bottom_margin' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 384

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      link == o.link &&
      is_hf_diff_first == o.is_hf_diff_first &&
      fit_to_pages_wide == o.fit_to_pages_wide &&
      print_quality == o.print_quality &&
      print_draft == o.print_draft &&
      first_page_number == o.first_page_number &&
      paper_size == o.paper_size &&
      print_comments == o.print_comments &&
      print_errors == o.print_errors &&
      center_vertically == o.center_vertically &&
      is_percent_scale == o.is_percent_scale &&
      black_and_white == o.black_and_white &&
      print_title_columns == o.print_title_columns &&
      is_hf_align_margins == o.is_hf_align_margins &&
      print_area == o.print_area &&
      footer_margin == o.footer_margin &&
      left_margin == o.left_margin &&
      center_horizontally == o.center_horizontally &&
      header_margin == o.header_margin &&
      top_margin == o.top_margin &&
      footer == o.footer &&
      fit_to_pages_tall == o.fit_to_pages_tall &&
      is_hf_scale_with_doc == o.is_hf_scale_with_doc &&
      print_headings == o.print_headings &&
      zoom == o.zoom &&
      print_title_rows == o.print_title_rows &&
      order == o.order &&
      print_copies == o.print_copies &&
      orientation == o.orientation &&
      right_margin == o.right_margin &&
      print_gridlines == o.print_gridlines &&
      is_auto_first_page_number == o.is_auto_first_page_number &&
      header == o.header &&
      is_hf_diff_odd_even == o.is_hf_diff_odd_even &&
      bottom_margin == o.bottom_margin
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type



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
494
495
496
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 460

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.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 = AsposeCellsCloud.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



526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 526

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



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 439

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    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 attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

See Also:

  • `==` method


426
427
428
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 426

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.



432
433
434
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 432

def hash
  [link, is_hf_diff_first, fit_to_pages_wide, print_quality, print_draft, first_page_number, paper_size, print_comments, print_errors, center_vertically, is_percent_scale, black_and_white, print_title_columns, is_hf_align_margins, print_area, footer_margin, left_margin, center_horizontally, header_margin, top_margin, footer, fit_to_pages_tall, is_hf_scale_with_doc, print_headings, zoom, print_title_rows, order, print_copies, orientation, right_margin, print_gridlines, is_auto_first_page_number, header, is_hf_diff_odd_even, bottom_margin].hash
end

#list_invalid_propertiesObject

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



371
372
373
374
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 371

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)



506
507
508
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 506

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash



512
513
514
515
516
517
518
519
520
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 512

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



500
501
502
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 500

def to_s
  to_hash.to_s
end

#valid?Boolean

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



378
379
380
# File 'lib/aspose_cells_cloud/models/page_setup.rb', line 378

def valid?
  return true
end