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
34
35
|
# File 'lib/asposeslidesjava/Text/shadoweffects.rb', line 3
def initialize()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/Text/'
pres = Rjb::import('com.aspose.slides.Presentation').new
slide = pres.getSlides().get_Item(0)
shp = slide.getShapes().addAutoShape(Rjb::import('com.aspose.slides.ShapeType').Rectangle, 150, 75, 150, 50)
shp.addTextFrame("Aspose TextBox")
shp.getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').NoFill)
shp.getEffectFormat().enableOuterShadowEffect()
shadow = shp.getEffectFormat().getOuterShadowEffect()
shadow.setBlurRadius(4.0)
shadow.setDirection(45)
shadow.setDistance(3)
shadow.setRectangleAlign(Rjb::import('com.aspose.slides.RectangleAlignment').TopLeft)
shadow.getShadowColor().setColor(Rjb::import('java.awt.Color').black)
save_format = Rjb::import('com.aspose.slides.SaveFormat')
pres.save(data_dir + "OutShadow.pptx", save_format.Pptx)
puts "Applied shadow effects on text, please check the output file."
end
|