3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/asposeslidesjava/Shapes/groupshape.rb', line 3
def initialize()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/Shapes/'
pres = Rjb::import('com.aspose.slides.Presentation').new(data_dir + 'demo.pptx')
sld = pres.getSlides().get_Item(0)
slide_shapes = sld.getShapes()
group_shape = slide_shapes.addGroupShape()
shape_type = Rjb::import('com.aspose.slides.ShapeType')
group_shape.getShapes().addAutoShape(shape_type.Rectangle, 300, 100, 100, 100)
group_shape.getShapes().addAutoShape(shape_type.Rectangle, 500, 100, 100, 100)
group_shape.getShapes().addAutoShape(shape_type.Rectangle, 300, 300, 100, 100)
group_shape.getShapes().addAutoShape(shape_type.Rectangle, 500, 300, 100, 100)
group_shape.setFrame(Rjb::import('com.aspose.slides.ShapeFrame').new(100, 300, 500, 40, Rjb::import('com.aspose.slides.NullableBool').False, Rjb::import('com.aspose.slides.NullableBool').False, 0))
save_format = Rjb::import('com.aspose.slides.SaveFormat')
pres.save(data_dir + "GroupShape.pptx", save_format.Pptx)
puts "Added group shape, please check the output file."
end
|