aspose_slides_cloud 23.1.0 → 23.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,48 @@ module AsposeSlidesCloud
31
31
  # Gets or sets text wrapping shape.
32
32
  attr_accessor :transform
33
33
 
34
+ # Left margin. Left margin.
35
+ attr_accessor :margin_left
36
+
37
+ # Right margin.
38
+ attr_accessor :margin_right
39
+
40
+ # Top margin.
41
+ attr_accessor :margin_top
42
+
43
+ # Bottom margin.
44
+ attr_accessor :margin_bottom
45
+
46
+ # True if text is wrapped at TextFrame's margins.
47
+ attr_accessor :wrap_text
48
+
49
+ # Returns or sets vertical anchor text in a TextFrame.
50
+ attr_accessor :anchoring_type
51
+
52
+ # If True then text should be centered in box horizontally.
53
+ attr_accessor :center_text
54
+
55
+ # Determines text orientation. The resulted value of visual text rotation summarized from this property and custom angle in property RotationAngle.
56
+ attr_accessor :text_vertical_type
57
+
58
+ # Returns or sets text's auto-fit mode.
59
+ attr_accessor :autofit_type
60
+
61
+ # Returns or sets number of columns in the text area. This value must be a positive number. Otherwise, the value will be set to zero. Value 0 means undefined value.
62
+ attr_accessor :column_count
63
+
64
+ # Returns or sets the space between text columns in the text area (in points). This should only apply when there is more than 1 column present. This value must be a positive number. Otherwise, the value will be set to zero.
65
+ attr_accessor :column_spacing
66
+
67
+ # Returns or set keeping text out of 3D scene entirely.
68
+ attr_accessor :keep_text_flat
69
+
70
+ # Specifies the custom rotation that is being applied to the text within the bounding box.
71
+ attr_accessor :rotation_angle
72
+
73
+ # Default portion format.
74
+ attr_accessor :default_paragraph_format
75
+
34
76
  class EnumAttributeValidator
35
77
  attr_reader :datatype
36
78
  attr_reader :allowable_values
@@ -58,6 +100,20 @@ module AsposeSlidesCloud
58
100
  {
59
101
  :'three_d_format' => :'ThreeDFormat',
60
102
  :'transform' => :'Transform',
103
+ :'margin_left' => :'MarginLeft',
104
+ :'margin_right' => :'MarginRight',
105
+ :'margin_top' => :'MarginTop',
106
+ :'margin_bottom' => :'MarginBottom',
107
+ :'wrap_text' => :'WrapText',
108
+ :'anchoring_type' => :'AnchoringType',
109
+ :'center_text' => :'CenterText',
110
+ :'text_vertical_type' => :'TextVerticalType',
111
+ :'autofit_type' => :'AutofitType',
112
+ :'column_count' => :'ColumnCount',
113
+ :'column_spacing' => :'ColumnSpacing',
114
+ :'keep_text_flat' => :'KeepTextFlat',
115
+ :'rotation_angle' => :'RotationAngle',
116
+ :'default_paragraph_format' => :'DefaultParagraphFormat',
61
117
  }
62
118
  end
63
119
 
@@ -66,6 +122,20 @@ module AsposeSlidesCloud
66
122
  {
67
123
  :'three_d_format' => :'ThreeDFormat',
68
124
  :'transform' => :'String',
125
+ :'margin_left' => :'Float',
126
+ :'margin_right' => :'Float',
127
+ :'margin_top' => :'Float',
128
+ :'margin_bottom' => :'Float',
129
+ :'wrap_text' => :'String',
130
+ :'anchoring_type' => :'String',
131
+ :'center_text' => :'String',
132
+ :'text_vertical_type' => :'String',
133
+ :'autofit_type' => :'String',
134
+ :'column_count' => :'Integer',
135
+ :'column_spacing' => :'Float',
136
+ :'keep_text_flat' => :'BOOLEAN',
137
+ :'rotation_angle' => :'Float',
138
+ :'default_paragraph_format' => :'ParagraphFormat',
69
139
  }
70
140
  end
71
141
 
@@ -84,6 +154,62 @@ module AsposeSlidesCloud
84
154
  if attributes.has_key?(:'Transform')
85
155
  self.transform = attributes[:'Transform']
86
156
  end
157
+
158
+ if attributes.has_key?(:'MarginLeft')
159
+ self.margin_left = attributes[:'MarginLeft']
160
+ end
161
+
162
+ if attributes.has_key?(:'MarginRight')
163
+ self.margin_right = attributes[:'MarginRight']
164
+ end
165
+
166
+ if attributes.has_key?(:'MarginTop')
167
+ self.margin_top = attributes[:'MarginTop']
168
+ end
169
+
170
+ if attributes.has_key?(:'MarginBottom')
171
+ self.margin_bottom = attributes[:'MarginBottom']
172
+ end
173
+
174
+ if attributes.has_key?(:'WrapText')
175
+ self.wrap_text = attributes[:'WrapText']
176
+ end
177
+
178
+ if attributes.has_key?(:'AnchoringType')
179
+ self.anchoring_type = attributes[:'AnchoringType']
180
+ end
181
+
182
+ if attributes.has_key?(:'CenterText')
183
+ self.center_text = attributes[:'CenterText']
184
+ end
185
+
186
+ if attributes.has_key?(:'TextVerticalType')
187
+ self.text_vertical_type = attributes[:'TextVerticalType']
188
+ end
189
+
190
+ if attributes.has_key?(:'AutofitType')
191
+ self.autofit_type = attributes[:'AutofitType']
192
+ end
193
+
194
+ if attributes.has_key?(:'ColumnCount')
195
+ self.column_count = attributes[:'ColumnCount']
196
+ end
197
+
198
+ if attributes.has_key?(:'ColumnSpacing')
199
+ self.column_spacing = attributes[:'ColumnSpacing']
200
+ end
201
+
202
+ if attributes.has_key?(:'KeepTextFlat')
203
+ self.keep_text_flat = attributes[:'KeepTextFlat']
204
+ end
205
+
206
+ if attributes.has_key?(:'RotationAngle')
207
+ self.rotation_angle = attributes[:'RotationAngle']
208
+ end
209
+
210
+ if attributes.has_key?(:'DefaultParagraphFormat')
211
+ self.default_paragraph_format = attributes[:'DefaultParagraphFormat']
212
+ end
87
213
  end
88
214
 
89
215
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -98,6 +224,16 @@ module AsposeSlidesCloud
98
224
  def valid?
99
225
  transform_validator = EnumAttributeValidator.new('String', ['None', 'Plain', 'Stop', 'Triangle', 'TriangleInverted', 'Chevron', 'ChevronInverted', 'RingInside', 'RingOutside', 'ArchUp', 'ArchDown', 'Circle', 'Button', 'ArchUpPour', 'ArchDownPour', 'CirclePour', 'ButtonPour', 'CurveUp', 'CurveDown', 'CanUp', 'CanDown', 'Wave1', 'Wave2', 'DoubleWave1', 'Wave4', 'Inflate', 'Deflate', 'InflateBottom', 'DeflateBottom', 'InflateTop', 'DeflateTop', 'DeflateInflate', 'DeflateInflateDeflate', 'FadeRight', 'FadeLeft', 'FadeUp', 'FadeDown', 'SlantUp', 'SlantDown', 'CascadeUp', 'CascadeDown', 'Custom', 'NotDefined'])
100
226
  return false unless transform_validator.valid?(@transform)
227
+ wrap_text_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
228
+ return false unless wrap_text_validator.valid?(@wrap_text)
229
+ anchoring_type_validator = EnumAttributeValidator.new('String', ['Top', 'Center', 'Bottom', 'Justified', 'Distributed', 'NotDefined'])
230
+ return false unless anchoring_type_validator.valid?(@anchoring_type)
231
+ center_text_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
232
+ return false unless center_text_validator.valid?(@center_text)
233
+ text_vertical_type_validator = EnumAttributeValidator.new('String', ['Horizontal', 'Vertical', 'Vertical270', 'WordArtVertical', 'EastAsianVertical', 'MongolianVertical', 'WordArtVerticalRightToLeft', 'NotDefined'])
234
+ return false unless text_vertical_type_validator.valid?(@text_vertical_type)
235
+ autofit_type_validator = EnumAttributeValidator.new('String', ['None', 'Normal', 'Shape', 'NotDefined'])
236
+ return false unless autofit_type_validator.valid?(@autofit_type)
101
237
  true
102
238
  end
103
239
 
@@ -111,13 +247,77 @@ module AsposeSlidesCloud
111
247
  @transform = transform
112
248
  end
113
249
 
250
+ # Custom attribute writer method checking allowed values (enum).
251
+ # @param [Object] wrap_text Object to be assigned
252
+ def wrap_text=(wrap_text)
253
+ validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
254
+ unless validator.valid?(wrap_text)
255
+ fail ArgumentError, 'invalid value for "wrap_text", must be one of #{validator.allowable_values}.'
256
+ end
257
+ @wrap_text = wrap_text
258
+ end
259
+
260
+ # Custom attribute writer method checking allowed values (enum).
261
+ # @param [Object] anchoring_type Object to be assigned
262
+ def anchoring_type=(anchoring_type)
263
+ validator = EnumAttributeValidator.new('String', ['Top', 'Center', 'Bottom', 'Justified', 'Distributed', 'NotDefined'])
264
+ unless validator.valid?(anchoring_type)
265
+ fail ArgumentError, 'invalid value for "anchoring_type", must be one of #{validator.allowable_values}.'
266
+ end
267
+ @anchoring_type = anchoring_type
268
+ end
269
+
270
+ # Custom attribute writer method checking allowed values (enum).
271
+ # @param [Object] center_text Object to be assigned
272
+ def center_text=(center_text)
273
+ validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
274
+ unless validator.valid?(center_text)
275
+ fail ArgumentError, 'invalid value for "center_text", must be one of #{validator.allowable_values}.'
276
+ end
277
+ @center_text = center_text
278
+ end
279
+
280
+ # Custom attribute writer method checking allowed values (enum).
281
+ # @param [Object] text_vertical_type Object to be assigned
282
+ def text_vertical_type=(text_vertical_type)
283
+ validator = EnumAttributeValidator.new('String', ['Horizontal', 'Vertical', 'Vertical270', 'WordArtVertical', 'EastAsianVertical', 'MongolianVertical', 'WordArtVerticalRightToLeft', 'NotDefined'])
284
+ unless validator.valid?(text_vertical_type)
285
+ fail ArgumentError, 'invalid value for "text_vertical_type", must be one of #{validator.allowable_values}.'
286
+ end
287
+ @text_vertical_type = text_vertical_type
288
+ end
289
+
290
+ # Custom attribute writer method checking allowed values (enum).
291
+ # @param [Object] autofit_type Object to be assigned
292
+ def autofit_type=(autofit_type)
293
+ validator = EnumAttributeValidator.new('String', ['None', 'Normal', 'Shape', 'NotDefined'])
294
+ unless validator.valid?(autofit_type)
295
+ fail ArgumentError, 'invalid value for "autofit_type", must be one of #{validator.allowable_values}.'
296
+ end
297
+ @autofit_type = autofit_type
298
+ end
299
+
114
300
  # Checks equality by comparing each attribute.
115
301
  # @param [Object] Object to be compared
116
302
  def ==(o)
117
303
  return true if self.equal?(o)
118
304
  self.class == o.class &&
119
305
  three_d_format == o.three_d_format &&
120
- transform == o.transform
306
+ transform == o.transform &&
307
+ margin_left == o.margin_left &&
308
+ margin_right == o.margin_right &&
309
+ margin_top == o.margin_top &&
310
+ margin_bottom == o.margin_bottom &&
311
+ wrap_text == o.wrap_text &&
312
+ anchoring_type == o.anchoring_type &&
313
+ center_text == o.center_text &&
314
+ text_vertical_type == o.text_vertical_type &&
315
+ autofit_type == o.autofit_type &&
316
+ column_count == o.column_count &&
317
+ column_spacing == o.column_spacing &&
318
+ keep_text_flat == o.keep_text_flat &&
319
+ rotation_angle == o.rotation_angle &&
320
+ default_paragraph_format == o.default_paragraph_format
121
321
  end
122
322
 
123
323
  # @see the `==` method
@@ -129,7 +329,7 @@ module AsposeSlidesCloud
129
329
  # Calculates hash code according to all attributes.
130
330
  # @return [Fixnum] Hash code
131
331
  def hash
132
- [three_d_format, transform].hash
332
+ [three_d_format, transform, margin_left, margin_right, margin_top, margin_bottom, wrap_text, anchoring_type, center_text, text_vertical_type, autofit_type, column_count, column_spacing, keep_text_flat, rotation_angle, default_paragraph_format].hash
133
333
  end
134
334
 
135
335
  # Builds the object from hash
@@ -374,6 +374,7 @@ module AsposeSlidesCloud
374
374
  :'OuterShadowEffect' => { },
375
375
  :'OutputFile' => { },
376
376
  :'Paragraph' => { },
377
+ :'ParagraphFormat' => { },
377
378
  :'Paragraphs' => { },
378
379
  :'PathInputFile' => { :'Type' => 'Path', },
379
380
  :'PathOutputFile' => { :'Type' => 'Path', },
@@ -21,5 +21,5 @@ SOFTWARE.
21
21
  =end
22
22
 
23
23
  module AsposeSlidesCloud
24
- VERSION = '23.1.0'
24
+ VERSION = '23.2.0'
25
25
  end
@@ -174,6 +174,7 @@ require 'aspose_slides_cloud/models/ordered_merge_request'
174
174
  require 'aspose_slides_cloud/models/outer_shadow_effect'
175
175
  require 'aspose_slides_cloud/models/output_file'
176
176
  require 'aspose_slides_cloud/models/paragraph'
177
+ require 'aspose_slides_cloud/models/paragraph_format'
177
178
  require 'aspose_slides_cloud/models/paragraphs'
178
179
  require 'aspose_slides_cloud/models/path_input_file'
179
180
  require 'aspose_slides_cloud/models/path_output_file'
@@ -20459,6 +20459,66 @@ describe 'SlidesApi' do
20459
20459
  end
20460
20460
  end
20461
20461
 
20462
+ # unit tests for download_shape_from_dto
20463
+ # Creates the shape from the DTO and returns the result in the specified format.
20464
+ # @param format Export format
20465
+ # @param dto Shape DTO.
20466
+ # @param [Hash] opts the optional parameters
20467
+ # @return [File]
20468
+ describe 'download_shape_from_dto test' do
20469
+ it 'should work' do
20470
+ paramformat = AsposeSlidesCloud::SpecUtils.get_param_value('format', 'DownloadShapeFromDto', 'String')
20471
+ paramdto = AsposeSlidesCloud::SpecUtils.get_param_value('dto', 'DownloadShapeFromDto', 'ShapeBase')
20472
+ AsposeSlidesCloud::SpecUtils.initialize('DownloadShapeFromDto', nil, nil)
20473
+ o, c, _h = AsposeSlidesCloud::SpecUtils.api.download_shape_from_dto_with_http_info(paramformat, paramdto)
20474
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('DownloadShapeFromDto', nil, nil, nil)
20475
+ expect(c).to eq(code)
20476
+ expect(o).not_to be_nil
20477
+ end
20478
+
20479
+ it 'invalid format' do
20480
+ paramformat = AsposeSlidesCloud::SpecUtils.get_param_value('format', 'DownloadShapeFromDto', 'String')
20481
+ paramdto = AsposeSlidesCloud::SpecUtils.get_param_value('dto', 'DownloadShapeFromDto', 'ShapeBase')
20482
+ paramformat = AsposeSlidesCloud::SpecUtils.invalidize_param_value('format', 'DownloadShapeFromDto', paramformat, 'String')
20483
+ AsposeSlidesCloud::SpecUtils.initialize('DownloadShapeFromDto', 'format', paramformat)
20484
+ begin
20485
+ AsposeSlidesCloud::SpecUtils.api.download_shape_from_dto_with_http_info(paramformat, paramdto)
20486
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('DownloadShapeFromDto', 'format')
20487
+ fail "An exception expected"
20488
+ end
20489
+ rescue AsposeSlidesCloud::ApiError => e
20490
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('DownloadShapeFromDto', 'format', paramformat, 'String')
20491
+ expect(e.code).to eq(code)
20492
+ expect(e.response_body).to include(message)
20493
+ rescue ArgumentError => e
20494
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('DownloadShapeFromDto', 'format', paramformat, 'String')
20495
+ expect(400).to eq(code)
20496
+ expect(e.message).to include(message)
20497
+ end
20498
+ end
20499
+
20500
+ it 'invalid dto' do
20501
+ paramformat = AsposeSlidesCloud::SpecUtils.get_param_value('format', 'DownloadShapeFromDto', 'String')
20502
+ paramdto = AsposeSlidesCloud::SpecUtils.get_param_value('dto', 'DownloadShapeFromDto', 'ShapeBase')
20503
+ paramdto = AsposeSlidesCloud::SpecUtils.invalidize_param_value('dto', 'DownloadShapeFromDto', paramdto, 'ShapeBase')
20504
+ AsposeSlidesCloud::SpecUtils.initialize('DownloadShapeFromDto', 'dto', paramdto)
20505
+ begin
20506
+ AsposeSlidesCloud::SpecUtils.api.download_shape_from_dto_with_http_info(paramformat, paramdto)
20507
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('DownloadShapeFromDto', 'dto')
20508
+ fail "An exception expected"
20509
+ end
20510
+ rescue AsposeSlidesCloud::ApiError => e
20511
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('DownloadShapeFromDto', 'dto', paramdto, 'ShapeBase')
20512
+ expect(e.code).to eq(code)
20513
+ expect(e.response_body).to include(message)
20514
+ rescue ArgumentError => e
20515
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('DownloadShapeFromDto', 'dto', paramdto, 'ShapeBase')
20516
+ expect(400).to eq(code)
20517
+ expect(e.message).to include(message)
20518
+ end
20519
+ end
20520
+ end
20521
+
20462
20522
  # unit tests for download_shape_online
20463
20523
  # Render shape to specified picture format.
20464
20524
  # @param document Document data.
@@ -590,5 +590,15 @@ describe 'UseCases' do
590
590
  sub_node_path, "password", folder_name)
591
591
  expect(response.nodes[0].nodes.length).to eq(3)
592
592
  end
593
+
594
+ it "download shape from DTO" do
595
+ shape = AsposeSlidesCloud::Shape.new
596
+ shape.shape_type = "Rectangle"
597
+ shape.width = 400
598
+ shape.height = 200
599
+ shape.text = "Shape text"
600
+
601
+ response = AsposeSlidesCloud::SpecUtils.api.download_shape_from_dto(AsposeSlidesCloud::ShapeExportFormat::PNG, shape)
602
+ end
593
603
  end
594
604
  end
@@ -70,5 +70,35 @@ describe 'UseCases' do
70
70
  result = AsposeSlidesCloud::SpecUtils.api.create_shape(file_name, slide_index, dto, nil, nil, password, folder_name)
71
71
  expect(result).to be_kind_of(AsposeSlidesCloud::Shape)
72
72
  end
73
+
74
+ it "text frame format" do
75
+ folder_name = "TempSlidesSDK"
76
+ file_name = "test.pptx"
77
+ password = "password"
78
+ slide_index = 1
79
+ AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
80
+
81
+ dto = AsposeSlidesCloud::Shape.new
82
+ dto.shape_type = "Rectangle"
83
+ dto.x = 100
84
+ dto.y = 100
85
+ dto.height = 100
86
+ dto.width = 200
87
+ dto.text = "Sample text"
88
+
89
+ dto.text_frame_format = AsposeSlidesCloud::TextFrameFormat.new
90
+ dto.text_frame_format.center_text = "True"
91
+ dto.text_frame_format.margin_left = 2
92
+ dto.text_frame_format.margin_right = 2
93
+ dto.text_frame_format.margin_top = 2
94
+ dto.text_frame_format.margin_bottom = 2
95
+ dto.text_frame_format.default_paragraph_format = AsposeSlidesCloud::ParagraphFormat.new
96
+ solidFill = AsposeSlidesCloud::SolidFill.new
97
+ solidFill.color = "#FF0000"
98
+ dto.text_frame_format.default_paragraph_format.bullet_fill_format = solidFill
99
+
100
+ result = AsposeSlidesCloud::SpecUtils.api.create_shape(file_name, slide_index, dto, nil, nil, password, folder_name)
101
+ expect(result).to be_kind_of(AsposeSlidesCloud::Shape)
102
+ end
73
103
  end
74
104
  end
data/testRules.json CHANGED
@@ -45,6 +45,7 @@
45
45
  { "Value": [2, 1], "Parameter": "OldPositions" },
46
46
  { "Value": [1, 2], "Parameter": "NewPositions" },
47
47
  { "Value": {}, "InvalidValue": null, "Type": "model" },
48
+ { "Value": { "Type": "Shape", "ShapeType": "Rectangle" }, "InvalidValue": null, "Type": "Shape" },
48
49
  { "Value": { "MasterSlide": { "Href": "masterSlides/2" } }, "Type": "LayoutSlide" },
49
50
  { "Value": { "DataPointType": "OneValue" }, "Type": "OneValueSeries" },
50
51
  { "Value": { "Type": "Scatter", "XValue": 32.5, "YValue": 42.9 }, "Type": "ScatterChartDataPoint" },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_slides_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.1.0
4
+ version: 23.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Putrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-31 00:00:00.000000000 Z
11
+ date: 2023-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -397,6 +397,7 @@ files:
397
397
  - lib/aspose_slides_cloud/models/outer_shadow_effect.rb
398
398
  - lib/aspose_slides_cloud/models/output_file.rb
399
399
  - lib/aspose_slides_cloud/models/paragraph.rb
400
+ - lib/aspose_slides_cloud/models/paragraph_format.rb
400
401
  - lib/aspose_slides_cloud/models/paragraphs.rb
401
402
  - lib/aspose_slides_cloud/models/path_input_file.rb
402
403
  - lib/aspose_slides_cloud/models/path_output_file.rb