All Projects → pythonicrubyist → Ruby_powerpoint

pythonicrubyist / Ruby_powerpoint

Licence: mit
A PowerPont parser in Ruby.

Programming Languages

ruby
36898 projects - #4 most used programming language

{Gem Version}[https://badge.fury.io/rb/ruby_powerpoint] {Downloads}[https://ruby-gem-downloads-badge.herokuapp.com/ruby_powerpoint?type=total&total_label=downloads]

= RubyPowerpoint -- Parser for Powerpoint(pptx) files.

ruby_powerpoint is a Ruby gem that can extract title, content and images from Powerpont(pptx) slides.

== Installation

RubyPowerpont can be used from the command line or as part of a Ruby web framework. To install the gem using terminal, run the following command:

gem install ruby_powerpoint

To use it in Rails, add this line to your Gemfile:

gem "ruby_powerpoint"

== Basic Usage RubyPowerpoint can parse a PowerPoint file(pptx) by extractng text and images from each slide:

require 'ruby_powerpoint'

deck = RubyPowerpoint::Presentation.new "specs/fixtures/sample.pptx"

deck.slides.each do |slide|
  slide.content # => ["Presentation Notes...", "12345"]
  slide.title # => "Prsentation Header"
  slide.images # => ["\xE3=\xA8h\x8E\x17\...."] Byte Stream
  # Saving the image byte stream to a file:
  File.open('temp.jpg', 'w'){|f| f.puts slide.images[0].read}
end

== Contributing

Contributions are welcomed. You can fork a repository, add your code changes to the forked branch, ensure all existing unit tests pass, create new unit tests cover your new changes and finally create a pull request.

After forking and then cloning the repository locally, install Bundler and then use it to install the development gem dependecies:

gem install bundler
bundle install

Once this is complete, you should be able to run the test suite:

rake

== Bug Reporting

Please use the {Issues}[https://github.com/pythonicrubyist/ruby_powerpoint/issues] page to report bugs or suggest new enhancements.

== License

RubyPowerpoint has been published under {MIT License}[https://github.com/pythonicrubyist/ruby_powerpoint/blob/master/LICENSE.txt]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].