Giter VIP home page Giter VIP logo

powerpoint's Introduction

version downloads

'powerpoint' gem -- for creating PowerPoint Slides in Ruby.

'powerpoint' is a Ruby gem that can generate PowerPoint files(pptx).

Installation

'powerpoint' 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 powerpoint

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

gem "powerpoint"

Basic Usage

'powerpoint' gem can generate a PowerPoint presentaion based on a standard template:

require 'powerpoint'

@deck = Powerpoint::Presentation.new

# Creating an introduction slide:
title = 'Bicycle Of the Mind'
subtitle = 'created by Steve Jobs'
@deck.add_intro title, subtitle

# Creating a text-only slide:
# Title must be a string.
# Content must be an array of strings that will be displayed as bullet items.
title = 'Why Mac?'
content = ['Its cool!', 'Its light.']
@deck.add_textual_slide title, content

# Creating an image Slide:
# It will contain a title as string.
# and an embeded image
title = 'Everyone loves Macs:'
image_path = 'samples/images/sample_gif.gif'
@deck.add_pictorial_slide title, image_path

# Specifying coordinates and image size for an embeded image.
# x and y values define the position of the image on the slide.
# cx and cy define the width and height of the image.
# x, y, cx, cy are in points. Each pixel is 12700 points.
# coordinates parameter is optional.
coords = {x: 124200, y: 3356451, cx: 2895600, cy: 1013460}
@deck.add_pictorial_slide title, image_path, coords

# Saving the pptx file to the current directory.
@deck.save('test.pptx')

Compatibility

'powerpoint' gem has been tested with LibreOffice (4.2.1.1) and Apache OpenOffice (4.0.1) on Mac OS X Mavericks, Microsoft PowerPoint 2010 on Windows 7 and Google Docs (latest version as of March 2014).

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 page to report bugs or suggest new enhancements.

License

Powerpoint has been published under MIT License

powerpoint's People

Contributors

benjaminwood avatar boopboopbeepboop avatar micahbrown avatar pythonicrubyist avatar scottb avatar ukd1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerpoint's Issues

Less Restrictive Slides

Would there be any way to make the slides a less strict regarding their content? For example, for my purposes I need a title slide with an image on the top with a title and subtitle under that, and a footer at the very bottom. At the moment it seems like a title slide cannot display images, but is it possible and I'm just missing something?

Powerpoints are saving as corrupt

I'm trying to generate a pptx file (an intro and image slides) based on user selection of some images. When I try accessing the file it returns as:

screen shot 2016-01-29 at 3 26 09 pm

Any ideas why this might happen? Would file size have anything to do with something like this?

not work with utf-8

i type some no-English words ,it not print out
how could i modify the source to complete that

sample.pptx won't open in Google Drive

If you upload sample.pptx to Google Drive it will fail and say there was a problem with the upload.

Many of the images do not display in Quick Look for OS X either, or when imported into Keynote.

I think something is wrong with how images are handled.

Remove bullet

  • Please help me. When i created a powerpoint. I don't show bullet points.
  • How to remove bullet points. I research but i can't remove it.

image

Thank you.

Sample.pptx image embed problems

Running rake spec seems to produce a PPTX where only the GIF image shows up while viewing in Keynote & Yosemite Preview.JPG/PNG/SVG do not show up. PNG embeds outside of spec also seems to have issues.

screen shot 2015-04-23 at 10 41 02 am

PPTX files are corrupted when XML special characters are used

Hi, we are using this gem in a project and noticed that some .pptx files were corrupted, then I found that is because text is not XML escaped. Quick and easy steps to reproduce it:

require 'powerpoint'
@deck = Powerpoint::Presentation.new
@deck.add_textual_slide 'A&B', ['test']
@deck.save('test.pptx')

Of course there's an easy workaround: escape text before adding it to the slides. But I think that it should be fixed or included in the README.md as a known issue.

Slide Duplicate

Is it possible to duplicate a given slide within a powerpoint?

A slide with charts, tables and other shapes.

Adding Notes

Is there any way to add slide notes? If not, is there a plan to?

Slides with different Templates

I want to create a Powerpoint with varying templates in the slides. For example, I have two template files - a.pptx and b.pptx. I want my slide to have the following theme:

Slide 1 => Template a
Slide 2 => Template b
Slide 3 => Template b
Slide 4 => Template a

I would like to know if this functionality currently exists, or if this is even possible using this Gem?

Possibility to add video

Hello,

Is this project still active ?

I would like to know if there is a way to add video to the powerpoint ?

Ability to choose aspect ratio

Hey man,

This project is awesome, but I was wondering if it would be possible to include an option for selecting a different aspect ratio:

4:3 cx="9144000" cy="6858000" (default)
16:10 cx="9144000" cy="5715000"
16:9 cx="9144000" cy="5143500"

I'll try to figure it out myself, but in the event you've already figured that out, I thought I'd ask ahead of time.

Save the ppt in browser

Hi guys,

How do I do to send the generated power point to the client side ?

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.