3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/asposeslidesjava/Shapes/oleobject.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 + 'OleEmbed.pptx')
sld = pres.getSlides().get_Item(0)
oof = sld.getShapes().get_Item(0)
if oof != nil
fstr = Rjb::import('java.io.FileOutputStream').new(data_dir + "excelFromOLEObject.xlsx")
buf = oof.getObjectData()
fstr.write(buf, 0, buf.length)
fstr.flush()
fstr.close()
puts "Excel OLE Object written as excelFromOLEObject.xlsx file"
end
end
|