Sha256: a439362ff59e602f4d6125f8f2186684408fd3e60f394f17f805c103b0403ad5

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 KB

Contents

module Asposeslidesjava
  module AccessSlides
    def initialize()
        # Using Slides Collection to Access Slide by Index
        get_slide_by_index()

        # Using Slides Collection to Access Slide by ID
        get_slide_by_id()
    end    

    def get_slide_by_index()
        data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
                
        # Instantiate Presentation class that represents the presentation file
        pres = Rjb::import('com.aspose.slides.Presentation').new(data_dir + 'Aspose.pptx')

        # Accessing a slide using its slide index
        slide = pres.getSlides().get_Item(0)

        puts "Slide: " + slide.to_string
    end    

    def get_slide_by_id()
        data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
                
        # Instantiate Presentation class that represents the presentation file
        pres = Rjb::import('com.aspose.slides.Presentation').new(data_dir + 'Aspose.pptx')

        # Getting Slide ID
        id = pres.getSlides().get_Item(0).getSlideId()
            
        # Accessing Slide by ID
        slide = pres.getSlideById(id)

        puts "Slide: " + slide.to_string
    end    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asposeslidesjava-0.0.2 lib/asposeslidesjava/Slides/accessslides.rb
asposeslidesjava-0.0.1 lib/asposeslidesjava/Slides/accessslides.rb