Module: Asposeslidesjava::ShapeThumbnail

Defined in:
lib/asposeslidesjava/Shapes/shapethumbnail.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/asposeslidesjava/Shapes/shapethumbnail.rb', line 3

def initialize()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/Shapes/'
            
    # Create an instance of Presentation class
    pres = Rjb::import('com.aspose.slides.Presentation').new(data_dir + 'demo.pptx')

    # Create a full scale image
    image = pres.getSlides().get_Item(0).getShapes().get_Item(0).getThumbnail()

    # Save the image to disk in PNG format
    Rjb::import('javax.imageio.ImageIO').write(image,"jpeg",Rjb::import('java.io.File').new(data_dir + "ShapeThumbnail.jpg"))

    puts "Generated shape Thumbnail from a slide, please check the output file."
end