Create New Presentations, Add Images & Slides via Free Ruby API
A Leading Open Source Ruby PPTX Library to Create, Read, Edit, & Manipulate PowerPoint PPTX Presentation. Add & Delete Slides, Text, Images via Free Ruby API
What is Ruby-PPTX Library?
PowerPoint automation is becoming a necessity for businesses, educators, and developers who need to build presentations at scale. Traditional methods often rely on bulky libraries or Microsoft-based tools, but the Ruby-PPTX gem offers a smarter alternative. This Open Source Ruby PPTX API lets software developers create new presentations via Ruby, directly within their applications—no PowerPoint installation needed. With Ruby-PPTX, you can add slides to presentations, insert text and images, apply custom styles or animations, and even export slides as images. It’s a lightweight and intuitive Ruby PowerPoint API designed for modern automation.
Developed by Nuvyu and licensed under MIT, Ruby-PPTX enables software developers to generate Office Open XML (.pptx) files using Ruby’s native file system, free of external dependencies. This makes it perfect for web apps or services built on Ruby or Ruby on Rails. Developers can add text to presentations, build consistent slide layouts, and integrate presentation generation into larger systems. Although it doesn’t yet natively convert PowerPoint to PDF via Ruby, it pairs well with other tools for that purpose. For anyone looking to convert PowerPoint PPTX online or automate slide creation, Ruby-PPTX offers a clean, reliable solution.
Getting Started with 'Ruby-PPTX'
The recommend way to install Ruby-PPTX Ruby library is using Ruby gem. Please use the following command for a smooth installation.
Install 'Ruby-PPTX' via Ruby gem
gem install ruby-pptx
Install Ruby-PPTX Ruby library via GitHub
git clone https://github.com/nuvyu/ruby-pptx.git
Create Presentations from Scratch via Ruby
Then open source Ruby-PPTX library makes it straightforward to create a new presentations from the scratch inside Ruby applications. The library has provided several important features for handling PowerPoint PPTX presentations such as inserting new slides, adding table to slides, specifying layout and title of the slide, inserting images to slides, adding text , deleting unwanted slides, applying styles and formatting and many more. Here is a simple example that demonstrates how to create a simple PPTX presentation inside Ruby application.
How to Create a Simple PPTX Presentation using Ruby API?
require 'ruby-pptx'
presentation = RubyPPTX::Presentation.new
presentation.add_slide do |slide|
slide.add_text('Welcome to Ruby-PPTX!', x: 100, y: 100, font_size: 32, color: '0000FF')
end
presentation.save('welcome.pptx')
Add Slides with Different Layouts to PPTX File via Ruby
The Ruby-PPTX library opens up a world of possibilities for Ruby developers looking to automate PowerPoint generation and handle slides inside it. The library makes it easy for software developers to add slides with various predefined layouts, add titles for slides, export slide’s contents, export slide to image, and delete slides inside Ruby applications. Here is a simple example that shows how software developers can add slides with various predefined layouts using Ruby commands.
How to Add Slides with Predefined Layouts inside Ruby App?
# Title slide
title_slide = presentation.add_slide(:title)
# Title and content slide
content_slide = presentation.add_slide(:title_content)
# Two content slide
two_content_slide = presentation.add_slide(:two_content)
# Comparison slide
comparison_slide = presentation.add_slide(:comparison)
# Blank slide
blank_slide = presentation.add_slide(:blank)
Work With Text & Images in PPTX Files via Ruby
The open source Ruby-PPTX library has provided complete functionality for working with text and images inside PowerPoint PPTX presentation using Ruby Library. With just a couple of lines of code, software developers can embed external images directly into slides, insert text, apply styles to existing text, remove unwanted part of the content, and so on. The following example shows how developers can insert an image to a presentation’s slide inside Ruby applications.
How to Insert an Image to Presentation’s Slide via Ruby API?
content_slide.add_image("/path/to/image.png", width: 300, height: 200, position: {x: 100, y: 150})