Sha256: cf0afc4bfead638089edaf79d4176af8d76612f61325332fb22c73300279a101

Contents?: true

Size: 958 Bytes

Versions: 2

Compression:

Stored size: 958 Bytes

Contents

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

        # Adding the Media Player ActiveX control
        pres.getSlides().get_Item(0).getControls().addControl(Rjb::import('com.aspose.slides.ControlType').WindowsMediaPlayer, 100, 100, 400, 400)

        # Access the Media Player ActiveX control and set the video path
        pres.getSlides().get_Item(0).getControls().get_Item(0).getProperties().set_Item("URL" ,  data_dir + "Wildlife.mp4")
        
        # Write the presentation as a PPTX file  
        pres.save(data_dir + "AddActiveX.pptx", Rjb::import('com.aspose.slides.SaveFormat').Pptx)

        puts "Added ActiveX control, please check the output file."
    end    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asposeslidesjava-0.0.2 lib/asposeslidesjava/ActiveX/addactivex.rb
asposeslidesjava-0.0.1 lib/asposeslidesjava/ActiveX/addactivex.rb