Skip to content

Commit 9d5b3cf

Browse files
committed
Aspose.Slides Java for Ruby
1 parent 8bfb6cf commit 9d5b3cf

File tree

105 files changed

+4094
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4094
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
3+
gemspec
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2001-2015 Aspose Pty Ltd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Aspose_Slides_Java_for_Ruby
2+
Aspose.Slides Java for Ruby is a gem that demonstrates / provides the Aspose.Slides for Java API usage examples in Ruby by using Rjb - Ruby Java Bridge.
3+
4+
## Installation
5+
6+
Execute following command.
7+
8+
$ gem install asposeslidesjava
9+
10+
To download Aspose.Slides for Java API to be used with these examples through RJB, Please navigate to:
11+
12+
http://www.aspose.com/community/files/72/java-components/aspose.slides-for-java/
13+
14+
Note: Create jars folder at root of the gem folder and copy downloaded Aspose.Slides for java component into it.
15+
16+
For most complete documentation of the project, check Aspose.Slides Java for Ruby confluence wiki link:
17+
18+
http://www.aspose.com/docs/display/slidesjava/3.+Aspose.Slides+Java+For+Ruby
19+
20+
## Usage
21+
22+
```ruby
23+
require File.dirname(File.dirname(File.dirname(__FILE__))) + '/lib/asposeslidesjava'
24+
include Asposeslidesjava
25+
include Asposeslidesjava::HelloWorld
26+
initialize_aspose_slides
27+
```
28+
Lets understand the above code
29+
* The first line makes sure that the aspose slides is loaded and available
30+
* Include the files that are required to access the aspose slides
31+
* Initialize the libraries. The aspose JAVA classes are loaded from the path provided in the aspose.yml file
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require "bundler/gem_tasks"
2+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# coding: utf-8
2+
lib = File.expand_path('../lib', __FILE__)
3+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4+
require 'asposeslidesjava/version'
5+
6+
Gem::Specification.new do |spec|
7+
spec.name = 'asposeslidesjava'
8+
spec.version = Asposeslidesjava::VERSION
9+
spec.authors = ['Aspose Marketplace']
10+
spec.email = ['[email protected]']
11+
spec.summary = %q{A Ruby gem to work with Aspose.Slides for Java libraries}
12+
spec.description = %q{AsposeSlidesJava is a Ruby gem that can help working with Aspose.Slides for Java libraries}
13+
spec.homepage = 'https://github.com/asposeslides/Aspose_Slides_Java/tree/master/Plugins/Aspose_Slides_Java_for_Ruby'
14+
spec.license = 'MIT'
15+
16+
spec.files = `git ls-files`.split($/)
17+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19+
spec.require_paths = ['lib']
20+
21+
spec.add_development_dependency 'bundler', '~> 1.7'
22+
spec.add_development_dependency 'rake', '~> 10.0'
23+
spec.add_development_dependency 'rspec'
24+
25+
spec.add_dependency 'rjb', '~> 1.5.2'
26+
27+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
jar_dir: ../asposeslidesjava/jars
2+
license_path: ../asposeslidesjava/license/path
3+
jvm_args: -Xms512m -Xmx1G
4+
5+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="X-UA-Compatible" content="IE=9">
5+
<style type="text/css">
6+
</style>
7+
</head>
8+
<body>
9+
<div class="slide" name="slide" id="slideslide1"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10in" height="7.5in" pointer-events="none" viewBox="0 0 720 540" version="1.1">
10+
<g text-rendering="geometricPrecision" pointer-events="painted" transform="scale(1,1)">
11+
<rect x="0" y="0" width="720" height="540" fill="#ffffff" />
12+
<g transform="matrix(1, 0, 0, 1, 55.1999969, 51.6000061)">
13+
<text font-family="Calibri" font-size="13.5pt" fill="#ff0000"><tspan x="0" y="16.8480015" textLength="13.625">1.</tspan>
14+
<tspan x="27" y="16.8480015" textLength="62.625">Text Box</tspan>
15+
<tspan x="0" y="38.448" textLength="13.625" fill="#953735">2.</tspan>
16+
<tspan x="27" y="38.448" textLength="62" fill="#953735">Hi There</tspan>
17+
</text>
18+
</g>
19+
<g transform="matrix(1, 0, 0, 1, 115.2, 153.6)">
20+
<text font-family="Calibri" font-size="36pt" fill="#558ed5"><tspan x="0" y="44.928" textLength="432">Aspose.Slides for .NET</tspan>
21+
</text>
22+
</g>
23+
<path fill="#4f81bd" d="M183 317.9L432 317.9 432 443.9 183 443.9z" />
24+
<path stroke-width="2" stroke="#385d8a" fill="none" d="M183 317.9L432 317.9 432 443.9 183 443.9z" />
25+
<path fill="#4f81bd" d="M480 365.1C480 320.4 520.3 284.1 570 284.1 619.7 284.1 660 320.4 660 365.1 660 409.9 619.7 446.1 570 446.1 520.3 446.1 480 409.9 480 365.1z" />
26+
<path stroke-width="2" stroke="#385d8a" fill="none" d="M480 365.1C480 320.4 520.3 284.1 570 284.1 619.7 284.1 660 320.4 660 365.1 660 409.9 619.7 446.1 570 446.1 520.3 446.1 480 409.9 480 365.1z" />
27+
<text font-family="Arial" font-weight="bold" font-size="18pt" fill="#ffd8cf" opacity="0.75"><tref xlink:href="#tp_0" x="268.973541" y="230.629776" fill="#000000" opacity="0.38" textLength="183.75"/><tref xlink:href="#tp_1" x="104.161026" y="257.4423" fill="#000000" opacity="0.38" textLength="513.375"/><tref xlink:href="#tp_2" x="149.473526" y="284.2548" fill="#000000" opacity="0.38" textLength="422.75"/></text>
28+
<text font-family="Arial" font-weight="bold" font-size="18pt" fill="#ffd8cf" opacity="0.75"><tspan x="268.125" y="229.78125" textLength="183.75" id="tp_0">Evaluation only.</tspan>
29+
<tspan x="103.3125" y="256.59375" textLength="513.375" id="tp_1">Created with Aspose.Slides for Java 15.4.0.0.</tspan>
30+
<tspan x="148.625" y="283.40625" textLength="422.75" id="tp_2">Copyright 2004-2015 Aspose Pty Ltd.</tspan>
31+
</text>
32+
</g>
33+
</svg></div>
34+
<div class="slide" name="slide" id="slideslide2"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10in" height="7.5in" pointer-events="none" viewBox="0 0 720 540" version="1.1">
35+
<g text-rendering="geometricPrecision" pointer-events="painted" transform="scale(1,1)">
36+
<rect x="0" y="0" width="720" height="540" fill="#ffffff" />
37+
<g transform="matrix(1, 0, 0, 1, 43.2000122, 25.2250366)">
38+
<text font-family="Calibri" font-size="33pt" fill="#558ed5"><tspan x="118.487488" y="56.184" textLength="396.625">Aspose.Slides for .NET</tspan>
39+
</text>
40+
</g>
41+
<g transform="matrix(1, 0, 0, 1, 43.2000122, 129.600037)">
42+
<text font-family="Arial" font-size="24pt" fill="#ff0000"><tspan x="0" y="29.9520016" textLength="11.25"></tspan>
43+
<tspan x="27" y="29.9520016" textLength="123.5" font-family="Calibri">Welcome</tspan>
44+
<tspan x="0" y="76.0320053" textLength="11.25" fill="#376092"></tspan>
45+
<tspan x="27" y="76.0320053" textLength="155.375" font-family="Calibri" fill="#376092">Hello World</tspan>
46+
</text>
47+
</g>
48+
<text font-family="Arial" font-weight="bold" font-size="18pt" fill="#ffd8cf" opacity="0.75"><tref xlink:href="#tp_0" x="268.973541" y="230.629776" fill="#000000" opacity="0.38" textLength="183.75"/><tref xlink:href="#tp_1" x="104.161026" y="257.4423" fill="#000000" opacity="0.38" textLength="513.375"/><tref xlink:href="#tp_2" x="149.473526" y="284.2548" fill="#000000" opacity="0.38" textLength="422.75"/></text>
49+
<text font-family="Arial" font-weight="bold" font-size="18pt" fill="#ffd8cf" opacity="0.75"><tspan x="268.125" y="229.78125" textLength="183.75" id="tp_0">Evaluation only.</tspan>
50+
<tspan x="103.3125" y="256.59375" textLength="513.375" id="tp_1">Created with Aspose.Slides for Java 15.4.0.0.</tspan>
51+
<tspan x="148.625" y="283.40625" textLength="422.75" id="tp_2">Copyright 2004-2015 Aspose Pty Ltd.</tspan>
52+
</text>
53+
</g>
54+
</svg></div></body>
55+
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Binary file not shown.
Binary file not shown.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
Version:1.0
2+
StartHTML:0000000105
3+
EndHTML:0000007396
4+
StartFragment:0000000433
5+
EndFragment:0000007356
6+
7+
<html xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
8+
xmlns="http://www.w3.org/TR/REC-html40">
9+
10+
<head>
11+
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
12+
<meta name=ProgId content=PowerPoint.Slide>
13+
<meta name=Generator content="Microsoft PowerPoint 14">
14+
</head>
15+
16+
<body>
17+
<!--StartFragment-->
18+
19+
<p style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:0in;
20+
text-indent:0in;text-align:center;direction:ltr;unicode-bidi:embed;tab-stops:
21+
left 409.63pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
22+
hanging'><span style='font-size:24.0pt;font-family:Calibri;mso-ascii-font-family:
23+
Calibri;mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
24+
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
25+
color:#0070C0;mso-font-kerning:12.0pt;language:en-US;font-weight:bold;
26+
mso-style-textfill-type:solid;mso-style-textfill-fill-color:#0070C0;mso-style-textfill-fill-alpha:
27+
100.0%'>Tasks to do:</span></p>
28+
29+
<div style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:.56in;
30+
text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;tab-stops:
31+
left 409.63pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
32+
hanging'><span style='font-size:24.0pt'><span style='mso-special-format:"numbullet3\,1";
33+
font-family:+mj-lt'>1.</span></span><span style='font-size:24.0pt;font-family:
34+
Calibri;mso-ascii-font-family:Calibri;mso-fareast-font-family:+mn-ea;
35+
mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:minor-latin;mso-fareast-theme-font:
36+
minor-fareast;mso-bidi-theme-font:minor-bidi;color:#898989;mso-color-index:
37+
1;mso-font-kerning:12.0pt;language:en-US;mso-style-textfill-type:solid;
38+
mso-style-textfill-fill-themecolor:text1;mso-style-textfill-fill-color:#898989;
39+
mso-style-textfill-fill-alpha:100.0%;mso-style-textfill-fill-colortransforms:
40+
tint=75000'>Feed the fish<span style='mso-tab-count:1'>  </span>done</span></div>
41+
42+
<div style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:.56in;
43+
text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;tab-stops:
44+
left 409.63pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
45+
hanging'><span style='font-size:24.0pt'><span style='mso-special-format:"numbullet3\,1";
46+
font-family:+mj-lt'>2.</span></span><u style='text-underline:single'><span
47+
style='font-size:24.0pt;font-family:Calibri;mso-ascii-font-family:Calibri;
48+
mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
49+
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
50+
color:#898989;mso-color-index:1;mso-font-kerning:12.0pt;language:en-US;
51+
font-style:italic;mso-style-textfill-type:solid;mso-style-textfill-fill-themecolor:
52+
text1;mso-style-textfill-fill-color:#898989;mso-style-textfill-fill-alpha:100.0%;
53+
mso-style-textfill-fill-colortransforms:tint=75000'>Buy some food</span></u></div>
54+
55+
<div class=O1 style='language:ru;margin-top:4.8pt;margin-bottom:0pt;margin-left:
56+
1.06in;text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;
57+
tab-stops:left 409.63pt;mso-line-break-override:none;word-break:normal;
58+
punctuation-wrap:hanging'><span style='font-size:20.0pt'><span
59+
style='mso-special-format:bullet;font-family:Arial'></span></span><span
60+
style='font-size:20.0pt;font-family:Calibri;mso-ascii-font-family:Calibri;
61+
mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
62+
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
63+
color:#898989;mso-color-index:1;mso-font-kerning:12.0pt;language:en-US;
64+
mso-style-textfill-type:solid;mso-style-textfill-fill-themecolor:text1;
65+
mso-style-textfill-fill-color:#898989;mso-style-textfill-fill-alpha:100.0%;
66+
mso-style-textfill-fill-colortransforms:tint=75000'>Bread<span
67+
style='mso-tab-count:1'>  </span>done</span></div>
68+
69+
<div class=O1 style='language:ru;margin-top:4.8pt;margin-bottom:0pt;margin-left:
70+
1.06in;text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;
71+
tab-stops:left 409.63pt;mso-line-break-override:none;word-break:normal;
72+
punctuation-wrap:hanging'><span style='font-size:20.0pt'><span
73+
style='mso-special-format:bullet;font-family:Arial'></span></span><span
74+
style='font-size:20.0pt;font-family:Calibri;mso-ascii-font-family:Calibri;
75+
mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
76+
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
77+
color:#898989;mso-color-index:1;mso-font-kerning:12.0pt;language:en-US;
78+
mso-style-textfill-type:solid;mso-style-textfill-fill-themecolor:text1;
79+
mso-style-textfill-fill-color:#898989;mso-style-textfill-fill-alpha:100.0%;
80+
mso-style-textfill-fill-colortransforms:tint=75000'>Milk<span style='mso-tab-count:
81+
1'>  </span>done</span></div>
82+
83+
<div style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:.56in;
84+
text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;tab-stops:
85+
left 409.63pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
86+
hanging'><span style='font-size:24.0pt'><span style='mso-special-format:"numbullet3\,1";
87+
font-family:+mj-lt'>3.</span></span><s style='text-line-through:single'><span
88+
style='font-size:24.0pt;font-family:Calibri;mso-ascii-font-family:Calibri;
89+
mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
90+
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
91+
color:#898989;mso-color-index:1;mso-font-kerning:12.0pt;language:en-US;
92+
mso-style-textfill-type:solid;mso-style-textfill-fill-themecolor:text1;
93+
mso-style-textfill-fill-color:#898989;mso-style-textfill-fill-alpha:100.0%;
94+
mso-style-textfill-fill-colortransforms:tint=75000'>W</span></s><s
95+
style='text-line-through:single'><span style='font-size:24.0pt;font-family:
96+
Calibri;mso-ascii-font-family:Calibri;mso-fareast-font-family:+mn-ea;
97+
mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:minor-latin;mso-fareast-theme-font:
98+
minor-fareast;mso-bidi-theme-font:minor-bidi;color:#898989;mso-color-index:
99+
1;mso-font-kerning:12.0pt;language:en-US;mso-style-textfill-type:solid;
100+
mso-style-textfill-fill-themecolor:text1;mso-style-textfill-fill-color:#898989;
101+
mso-style-textfill-fill-alpha:100.0%;mso-style-textfill-fill-colortransforms:
102+
tint=75000'>ash the clothes</span></s><span style='font-size:24.0pt;font-family:
103+
Calibri;mso-ascii-font-family:Calibri;mso-fareast-font-family:+mn-ea;
104+
mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:minor-latin;mso-fareast-theme-font:
105+
minor-fareast;mso-bidi-theme-font:minor-bidi;color:#898989;mso-color-index:
106+
1;mso-font-kerning:12.0pt;language:en-US;mso-style-textfill-type:solid;
107+
mso-style-textfill-fill-themecolor:text1;mso-style-textfill-fill-color:#898989;
108+
mso-style-textfill-fill-alpha:100.0%;mso-style-textfill-fill-colortransforms:
109+
tint=75000'><span style='mso-tab-count:1'>  </span>out of laundry detergent</span></div>
110+
111+
<p style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:0in;
112+
text-indent:0in;text-align:center;direction:ltr;unicode-bidi:embed;tab-stops:
113+
left 466.25pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
114+
hanging'></p>
115+
116+
<!--EndFragment-->
117+
</body>
118+
119+
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Binary file not shown.
Loading
Binary file not shown.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
require_relative 'asposeslidesjava/version'
2+
require_relative 'asposeslidesjava/asposeslides'
3+
require 'logger'
4+
require 'rjb'
5+
6+
module Asposeslidesjava
7+
8+
class << self
9+
attr_accessor :aspose_slides_config
10+
end
11+
12+
def initialize_aspose_slides
13+
aspose_jars_dir = Asposeslidesjava.aspose_slides_config ? Asposeslidesjava.aspose_slides_config['jar_dir'] : nil
14+
aspose_license_path = Asposeslidesjava.aspose_slides_config ? Asposeslidesjava.aspose_slides_config['license_path'] : nil
15+
jvm_args = Asposeslidesjava.aspose_slides_config ? Asposeslidesjava.aspose_slides_config['jvm_args'] : nil
16+
17+
load_aspose_jars(aspose_jars_dir, jvm_args)
18+
load_aspose_license(aspose_license_path)
19+
end
20+
21+
def load_aspose_license(aspose_license_path)
22+
if aspose_license_path && File.exist?(aspose_license_path)
23+
set_license(File.join(aspose_license_path))
24+
else
25+
logger = Logger.new(STDOUT)
26+
logger.level = Logger::WARN
27+
logger.warn('Using the non licensed aspose jar. Please specify path to your aspose license directory in config/aspose.yml file!')
28+
end
29+
end
30+
31+
def load_aspose_jars(aspose_jars_dir, jvm_args)
32+
if aspose_jars_dir && File.exist?(aspose_jars_dir)
33+
jardir = File.join(aspose_jars_dir, '**', '*.jar')
34+
else
35+
jardir = File.join(File.dirname(File.dirname(__FILE__)), 'jars', '**', '*.jar')
36+
end
37+
38+
if jvm_args
39+
args = jvm_args.split(' ') << '-Djava.awt.headless=true'
40+
logger = Logger.new(STDOUT)
41+
logger.level = Logger::DEBUG
42+
logger.debug("JVM args : #{args}")
43+
Rjb::load(classpath = Dir.glob(jardir).join(':'), jvmargs=args)
44+
else
45+
Rjb::load(classpath = Dir.glob(jardir).join(':'), jvmargs=['-Djava.awt.headless=true'])
46+
end
47+
48+
end
49+
50+
def input_file(file)
51+
Rjb::import('java.io.FileInputStream').new(file)
52+
end
53+
54+
def set_license(aspose_license_file)
55+
begin
56+
fstream = input_file(aspose_license_file)
57+
license = Rjb::import('com.aspose.api.License').new()
58+
license.setLicense(fstream)
59+
rescue Exception => ex
60+
logger = Logger.new(STDOUT)
61+
logger.level = Logger::ERROR
62+
logger.error("Could not load the license file : #{ex}")
63+
fstream.close() if fstream
64+
end
65+
end
66+
67+
def self.configure_aspose_slides config
68+
Asposecellsjava.aspose_slides_config = config
69+
end
70+
71+
end
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module Asposeslidesjava
2+
module AddActiveX
3+
def initialize()
4+
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
5+
6+
# Create an instance of Presentation class
7+
pres = Rjb::import('com.aspose.slides.Presentation').new
8+
9+
# Adding the Media Player ActiveX control
10+
pres.getSlides().get_Item(0).getControls().addControl(Rjb::import('com.aspose.slides.ControlType').WindowsMediaPlayer, 100, 100, 400, 400)
11+
12+
# Access the Media Player ActiveX control and set the video path
13+
pres.getSlides().get_Item(0).getControls().get_Item(0).getProperties().set_Item("URL" , data_dir + "Wildlife.mp4")
14+
15+
# Write the presentation as a PPTX file
16+
pres.save(data_dir + "AddActiveX.pptx", Rjb::import('com.aspose.slides.SaveFormat').Pptx)
17+
18+
puts "Added ActiveX control, please check the output file."
19+
end
20+
end
21+
end

0 commit comments

Comments
 (0)