Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gemspec
21 changes: 21 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2001-2015 Aspose Pty Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
31 changes: 31 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Aspose_Slides_Java_for_Ruby
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.

## Installation

Execute following command.

$ gem install asposeslidesjava

To download Aspose.Slides for Java API to be used with these examples through RJB, Please navigate to:

http://www.aspose.com/community/files/72/java-components/aspose.slides-for-java/

Note: Create jars folder at root of the gem folder and copy downloaded Aspose.Slides for java component into it.

For most complete documentation of the project, check Aspose.Slides Java for Ruby confluence wiki link:

http://www.aspose.com/docs/display/slidesjava/3.+Aspose.Slides+Java+For+Ruby

## Usage

```ruby
require File.dirname(File.dirname(File.dirname(__FILE__))) + '/lib/asposeslidesjava'
include Asposeslidesjava
include Asposeslidesjava::HelloWorld
initialize_aspose_slides
```
Lets understand the above code
* The first line makes sure that the aspose slides is loaded and available
* Include the files that are required to access the aspose slides
* Initialize the libraries. The aspose JAVA classes are loaded from the path provided in the aspose.yml file
2 changes: 2 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require "bundler/gem_tasks"

27 changes: 27 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/asposeslidesjava.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'asposeslidesjava/version'

Gem::Specification.new do |spec|
spec.name = 'asposeslidesjava'
spec.version = Asposeslidesjava::VERSION
spec.authors = ['Aspose Marketplace']
spec.email = ['marketplace@aspose.com']
spec.summary = %q{A Ruby gem to work with Aspose.Slides for Java libraries}
spec.description = %q{AsposeSlidesJava is a Ruby gem that can help working with Aspose.Slides for Java libraries}
spec.homepage = 'https://github.com/asposeslides/Aspose_Slides_Java/tree/master/Plugins/Aspose_Slides_Java_for_Ruby'
spec.license = 'MIT'

spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler', '~> 1.7'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec'

spec.add_dependency 'rjb', '~> 1.5.2'

end
5 changes: 5 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/config/aspose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
jar_dir: ../asposeslidesjava/jars
license_path: ../asposeslidesjava/license/path
jvm_args: -Xms512m -Xmx1G


55 changes: 55 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/data/Aspose.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9">
<style type="text/css">
</style>
</head>
<body>
<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">
<g text-rendering="geometricPrecision" pointer-events="painted" transform="scale(1,1)">
<rect x="0" y="0" width="720" height="540" fill="#ffffff" />
<g transform="matrix(1, 0, 0, 1, 55.1999969, 51.6000061)">
<text font-family="Calibri" font-size="13.5pt" fill="#ff0000"><tspan x="0" y="16.8480015" textLength="13.625">1.</tspan>
<tspan x="27" y="16.8480015" textLength="62.625">Text Box</tspan>
<tspan x="0" y="38.448" textLength="13.625" fill="#953735">2.</tspan>
<tspan x="27" y="38.448" textLength="62" fill="#953735">Hi There</tspan>
</text>
</g>
<g transform="matrix(1, 0, 0, 1, 115.2, 153.6)">
<text font-family="Calibri" font-size="36pt" fill="#558ed5"><tspan x="0" y="44.928" textLength="432">Aspose.Slides for .NET</tspan>
</text>
</g>
<path fill="#4f81bd" d="M183 317.9L432 317.9 432 443.9 183 443.9z" />
<path stroke-width="2" stroke="#385d8a" fill="none" d="M183 317.9L432 317.9 432 443.9 183 443.9z" />
<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" />
<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" />
<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>
<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>
<tspan x="103.3125" y="256.59375" textLength="513.375" id="tp_1">Created with Aspose.Slides for Java 15.4.0.0.</tspan>
<tspan x="148.625" y="283.40625" textLength="422.75" id="tp_2">Copyright 2004-2015 Aspose Pty Ltd.</tspan>
</text>
</g>
</svg></div>
<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">
<g text-rendering="geometricPrecision" pointer-events="painted" transform="scale(1,1)">
<rect x="0" y="0" width="720" height="540" fill="#ffffff" />
<g transform="matrix(1, 0, 0, 1, 43.2000122, 25.2250366)">
<text font-family="Calibri" font-size="33pt" fill="#558ed5"><tspan x="118.487488" y="56.184" textLength="396.625">Aspose.Slides for .NET</tspan>
</text>
</g>
<g transform="matrix(1, 0, 0, 1, 43.2000122, 129.600037)">
<text font-family="Arial" font-size="24pt" fill="#ff0000"><tspan x="0" y="29.9520016" textLength="11.25">•</tspan>
<tspan x="27" y="29.9520016" textLength="123.5" font-family="Calibri">Welcome</tspan>
<tspan x="0" y="76.0320053" textLength="11.25" fill="#376092">•</tspan>
<tspan x="27" y="76.0320053" textLength="155.375" font-family="Calibri" fill="#376092">Hello World</tspan>
</text>
</g>
<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>
<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>
<tspan x="103.3125" y="256.59375" textLength="513.375" id="tp_1">Created with Aspose.Slides for Java 15.4.0.0.</tspan>
<tspan x="148.625" y="283.40625" textLength="422.75" id="tp_2">Copyright 2004-2015 Aspose Pty Ltd.</tspan>
</text>
</g>
</svg></div></body>
</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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
119 changes: 119 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/data/Text/import.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
Version:1.0
StartHTML:0000000105
EndHTML:0000007396
StartFragment:0000000433
EndFragment:0000007356

<html xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=PowerPoint.Slide>
<meta name=Generator content="Microsoft PowerPoint 14">
</head>

<body>
<!--StartFragment-->

<p style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:0in;
text-indent:0in;text-align:center;direction:ltr;unicode-bidi:embed;tab-stops:
left 409.63pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
hanging'><span style='font-size:24.0pt;font-family:Calibri;mso-ascii-font-family:
Calibri;mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
color:#0070C0;mso-font-kerning:12.0pt;language:en-US;font-weight:bold;
mso-style-textfill-type:solid;mso-style-textfill-fill-color:#0070C0;mso-style-textfill-fill-alpha:
100.0%'>Tasks to do:</span></p>

<div style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:.56in;
text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;tab-stops:
left 409.63pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
hanging'><span style='font-size:24.0pt'><span style='mso-special-format:"numbullet3\,1";
font-family:+mj-lt'>1.</span></span><span style='font-size:24.0pt;font-family:
Calibri;mso-ascii-font-family:Calibri;mso-fareast-font-family:+mn-ea;
mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:minor-latin;mso-fareast-theme-font:
minor-fareast;mso-bidi-theme-font:minor-bidi;color:#898989;mso-color-index:
1;mso-font-kerning:12.0pt;language:en-US;mso-style-textfill-type:solid;
mso-style-textfill-fill-themecolor:text1;mso-style-textfill-fill-color:#898989;
mso-style-textfill-fill-alpha:100.0%;mso-style-textfill-fill-colortransforms:
tint=75000'>Feed the fish<span style='mso-tab-count:1'>  </span>done</span></div>

<div style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:.56in;
text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;tab-stops:
left 409.63pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
hanging'><span style='font-size:24.0pt'><span style='mso-special-format:"numbullet3\,1";
font-family:+mj-lt'>2.</span></span><u style='text-underline:single'><span
style='font-size:24.0pt;font-family:Calibri;mso-ascii-font-family:Calibri;
mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
color:#898989;mso-color-index:1;mso-font-kerning:12.0pt;language:en-US;
font-style:italic;mso-style-textfill-type:solid;mso-style-textfill-fill-themecolor:
text1;mso-style-textfill-fill-color:#898989;mso-style-textfill-fill-alpha:100.0%;
mso-style-textfill-fill-colortransforms:tint=75000'>Buy some food</span></u></div>

<div class=O1 style='language:ru;margin-top:4.8pt;margin-bottom:0pt;margin-left:
1.06in;text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;
tab-stops:left 409.63pt;mso-line-break-override:none;word-break:normal;
punctuation-wrap:hanging'><span style='font-size:20.0pt'><span
style='mso-special-format:bullet;font-family:Arial'>•</span></span><span
style='font-size:20.0pt;font-family:Calibri;mso-ascii-font-family:Calibri;
mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
color:#898989;mso-color-index:1;mso-font-kerning:12.0pt;language:en-US;
mso-style-textfill-type:solid;mso-style-textfill-fill-themecolor:text1;
mso-style-textfill-fill-color:#898989;mso-style-textfill-fill-alpha:100.0%;
mso-style-textfill-fill-colortransforms:tint=75000'>Bread<span
style='mso-tab-count:1'>  </span>done</span></div>

<div class=O1 style='language:ru;margin-top:4.8pt;margin-bottom:0pt;margin-left:
1.06in;text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;
tab-stops:left 409.63pt;mso-line-break-override:none;word-break:normal;
punctuation-wrap:hanging'><span style='font-size:20.0pt'><span
style='mso-special-format:bullet;font-family:Arial'>•</span></span><span
style='font-size:20.0pt;font-family:Calibri;mso-ascii-font-family:Calibri;
mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
color:#898989;mso-color-index:1;mso-font-kerning:12.0pt;language:en-US;
mso-style-textfill-type:solid;mso-style-textfill-fill-themecolor:text1;
mso-style-textfill-fill-color:#898989;mso-style-textfill-fill-alpha:100.0%;
mso-style-textfill-fill-colortransforms:tint=75000'>Milk<span style='mso-tab-count:
1'>  </span>done</span></div>

<div style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:.56in;
text-indent:-.56in;text-align:left;direction:ltr;unicode-bidi:embed;tab-stops:
left 409.63pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
hanging'><span style='font-size:24.0pt'><span style='mso-special-format:"numbullet3\,1";
font-family:+mj-lt'>3.</span></span><s style='text-line-through:single'><span
style='font-size:24.0pt;font-family:Calibri;mso-ascii-font-family:Calibri;
mso-fareast-font-family:+mn-ea;mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:
minor-latin;mso-fareast-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;
color:#898989;mso-color-index:1;mso-font-kerning:12.0pt;language:en-US;
mso-style-textfill-type:solid;mso-style-textfill-fill-themecolor:text1;
mso-style-textfill-fill-color:#898989;mso-style-textfill-fill-alpha:100.0%;
mso-style-textfill-fill-colortransforms:tint=75000'>W</span></s><s
style='text-line-through:single'><span style='font-size:24.0pt;font-family:
Calibri;mso-ascii-font-family:Calibri;mso-fareast-font-family:+mn-ea;
mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:minor-latin;mso-fareast-theme-font:
minor-fareast;mso-bidi-theme-font:minor-bidi;color:#898989;mso-color-index:
1;mso-font-kerning:12.0pt;language:en-US;mso-style-textfill-type:solid;
mso-style-textfill-fill-themecolor:text1;mso-style-textfill-fill-color:#898989;
mso-style-textfill-fill-alpha:100.0%;mso-style-textfill-fill-colortransforms:
tint=75000'>ash the clothes</span></s><span style='font-size:24.0pt;font-family:
Calibri;mso-ascii-font-family:Calibri;mso-fareast-font-family:+mn-ea;
mso-bidi-font-family:+mn-cs;mso-ascii-theme-font:minor-latin;mso-fareast-theme-font:
minor-fareast;mso-bidi-theme-font:minor-bidi;color:#898989;mso-color-index:
1;mso-font-kerning:12.0pt;language:en-US;mso-style-textfill-type:solid;
mso-style-textfill-fill-themecolor:text1;mso-style-textfill-fill-color:#898989;
mso-style-textfill-fill-alpha:100.0%;mso-style-textfill-fill-colortransforms:
tint=75000'><span style='mso-tab-count:1'>  </span>out of laundry detergent</span></div>

<p style='language:ru;margin-top:5.76pt;margin-bottom:0pt;margin-left:0in;
text-indent:0in;text-align:center;direction:ltr;unicode-bidi:embed;tab-stops:
left 466.25pt;mso-line-break-override:none;word-break:normal;punctuation-wrap:
hanging'></p>

<!--EndFragment-->
</body>

</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
71 changes: 71 additions & 0 deletions Plugins/Aspose_Slides_Java_for_Ruby/lib/asposeslidesjava.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
require_relative 'asposeslidesjava/version'
require_relative 'asposeslidesjava/asposeslides'
require 'logger'
require 'rjb'

module Asposeslidesjava

class << self
attr_accessor :aspose_slides_config
end

def initialize_aspose_slides
aspose_jars_dir = Asposeslidesjava.aspose_slides_config ? Asposeslidesjava.aspose_slides_config['jar_dir'] : nil
aspose_license_path = Asposeslidesjava.aspose_slides_config ? Asposeslidesjava.aspose_slides_config['license_path'] : nil
jvm_args = Asposeslidesjava.aspose_slides_config ? Asposeslidesjava.aspose_slides_config['jvm_args'] : nil

load_aspose_jars(aspose_jars_dir, jvm_args)
load_aspose_license(aspose_license_path)
end

def load_aspose_license(aspose_license_path)
if aspose_license_path && File.exist?(aspose_license_path)
set_license(File.join(aspose_license_path))
else
logger = Logger.new(STDOUT)
logger.level = Logger::WARN
logger.warn('Using the non licensed aspose jar. Please specify path to your aspose license directory in config/aspose.yml file!')
end
end

def load_aspose_jars(aspose_jars_dir, jvm_args)
if aspose_jars_dir && File.exist?(aspose_jars_dir)
jardir = File.join(aspose_jars_dir, '**', '*.jar')
else
jardir = File.join(File.dirname(File.dirname(__FILE__)), 'jars', '**', '*.jar')
end

if jvm_args
args = jvm_args.split(' ') << '-Djava.awt.headless=true'
logger = Logger.new(STDOUT)
logger.level = Logger::DEBUG
logger.debug("JVM args : #{args}")
Rjb::load(classpath = Dir.glob(jardir).join(':'), jvmargs=args)
else
Rjb::load(classpath = Dir.glob(jardir).join(':'), jvmargs=['-Djava.awt.headless=true'])
end

end

def input_file(file)
Rjb::import('java.io.FileInputStream').new(file)
end

def set_license(aspose_license_file)
begin
fstream = input_file(aspose_license_file)
license = Rjb::import('com.aspose.api.License').new()
license.setLicense(fstream)
rescue Exception => ex
logger = Logger.new(STDOUT)
logger.level = Logger::ERROR
logger.error("Could not load the license file : #{ex}")
fstream.close() if fstream
end
end

def self.configure_aspose_slides config
Asposecellsjava.aspose_slides_config = config
end

end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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
Loading