30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/asposeslidesjava/Shapes/addinglineshape.rb', line 30
def add_arrow_line()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/Shapes/'
pres = Rjb::import('com.aspose.slides.Presentation').new
sld = pres.getSlides().get_Item(0)
shp = sld.getShapes().addAutoShape(Rjb::import('com.aspose.slides.ShapeType').Line, 50, 150, 300, 0)
shp.getLineFormat().setStyle(Rjb::import('com.aspose.slides.LineStyle').ThickBetweenThin)
shp.getLineFormat().setWidth(10)
shp.getLineFormat().setDashStyle(Rjb::import('com.aspose.slides.LineDashStyle').DashDot)
shp.getLineFormat().setBeginArrowheadLength(Rjb::import('com.aspose.slides.LineArrowheadLength').Short)
shp.getLineFormat().setBeginArrowheadStyle(Rjb::import('com.aspose.slides.LineArrowheadStyle').Oval)
shp.getLineFormat().setEndArrowheadLength(Rjb::import('com.aspose.slides.LineArrowheadLength').Long)
shp.getLineFormat().setEndArrowheadStyle(Rjb::import('com.aspose.slides.LineArrowheadStyle').Triangle)
shp.getLineFormat().getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').new(Rjb::import('com.aspose.slides.PresetColor').Maroon))
save_format = Rjb::import('com.aspose.slides.SaveFormat')
pres.save(data_dir + "ArrowShape.pptx", save_format.Pptx)
puts "Added arrow shape line to slide, please check the output file."
end
|