Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to Split PowerPoint PPT or PPTX Presentations in Ruby

You can split PPTX slides programmatically on the cloud using Ruby Cloud REST API. In this article, you will learn how to split PowerPoint PPTX Slides using REST API in Ruby.

The following topics are covered in this article:

  1. PowerPoint Slides Splitter Cloud API and Ruby SDK
  2. Split PPTX to Single Slide File using REST API in Ruby
  3. Split PowerPoint into Multiple Slides File using Ruby
  4. Split PowerPoint PPTX by Page Number using REST API in Ruby
  5. Split PowerPoint PPTX by Page Range using REST API in Ruby
# How to Split PowerPoint PPTX by Page Number
# Create an instance of the Document API
@documentApi = GroupDocsMergerCloud::DocumentApi.from_keys(@app_sid, @app_key)
@options = GroupDocsMergerCloud::SplitOptions.new
@options.file_info = GroupDocsMergerCloud::FileInfo.new
@options.file_info.file_path = "split-slides/presentations.pptx"
@options.output_path = "split-slides"
@options.start_page_number = 3
@options.end_page_number = 7
@options.mode = "Pages"
@result = documentApi.split(GroupDocsMergerCloud::SplitRequest.new(@options))
puts("Split PPTX by Slide Number using REST API.")
# How to Split PowerPoint PPTX by Page Range
# Create an instance of the Document API
@documentApi = GroupDocsMergerCloud::DocumentApi.from_keys(@app_sid, @app_key)
@options = GroupDocsMergerCloud::SplitOptions.new
@options.file_info = GroupDocsMergerCloud::FileInfo.new
@options.file_info.file_path = "split-slides/presentations.pptx"
@options.output_path = "split-slides"
@options.start_page_number = 3
@options.end_page_number = 7
@options.range_mode = "OddPages"
@options.mode = "Intervals"
@result = @documentApi.split(GroupDocsMergerCloud::SplitRequest.new(@options))
puts("Split PPTX Slides by Page Range Mode.")
# How to Split PowerPoint into Multiple Slides File
# Create an instance of the Document API
@documentApi = GroupDocsMergerCloud::DocumentApi.from_keys(@app_sid, @app_key)
@options = GroupDocsMergerCloud::SplitOptions.new
@options.file_info = GroupDocsMergerCloud::FileInfo.new
@options.file_info.file_path = "split-slides/presentations.pptx"
@options.output_path = "split-slides"
@options.pages = [3, 6, 8]
@options.mode = "Intervals"
@result = @documentApi.split(GroupDocsMergerCloud::SplitRequest.new(@options))
puts("Split PPTX or PPT to Multiple Slides.")
# How to Split PPTX to Single Slide File
# Create an instance of the Document API
@documentApi = GroupDocsMergerCloud::DocumentApi.from_keys(@app_sid, @app_key)
@options = GroupDocsMergerCloud::SplitOptions.new
@options.file_info = GroupDocsMergerCloud::FileInfo.new
@options.file_info.file_path = "split-slides/presentations.pptx"
@options.output_path = "split-slides"
@options.pages = [1, 3]
@options.mode = "Pages"
@result = @documentApi.split(GroupDocsMergerCloud::SplitRequest.new(@options))
puts("Split PPTX into One Page Slide.")
# How to PowerPoint PPTX/PPT slides splitter works
# Load the gem https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby in Ruby application for http://api.groupdocs.cloud
require 'groupdocs_merger_cloud'
# Get your client_id and client_secret from https://dashboard.groupdocs.cloud after free registration.
@app_sid = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
@app_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment