Ruby에서 REST API를 사용하여 PowerPoint PPTX 슬라이드를 분할하는 방법

Ruby에서 REST API를 사용하여 PowerPoint PPTX 슬라이드를 분할하는 방법

PowerPoint PPT 또는 PPTX 프레젠테이션을 프로그래밍 방식으로 만들고 조작하는 동안 긴 PowerPoint 문서를 분할하여 별도의 PowerPoint 파일로 저장해야 할 수 있습니다. 큰 PowerPoint 문서를 원본 슬라이드가 있는 프레젠테이션으로 수동 분할하는 경우 시간이 많이 걸리는 작업입니다. 이 기사에서는 Ruby에서 PowerPoint PPT 또는 PPTX 프레젠테이션을 분할하는 방법에 대한 간단한 솔루션을 소개합니다.

이 문서에서는 다음 항목을 다룹니다.

PowerPoint PPTX Splitter Cloud API 및 Ruby SDK

PowerPoint PPTX/PPT 슬라이드를 분할하기 위해 GroupDocs.Merger Cloud API의 Ruby SDK를 사용할 것입니다. Word, Excel, Visio 도면, [PDF][의 지원되는 문서 형식에서 단일 페이지 또는 페이지 모음을 분할, 결합, 제거 및 재정렬할 수 있습니다. 8] 및 HTML.

터미널에서 다음 명령을 사용하여 Ruby 애플리케이션에 powerpoint splitter를 설치하고 다운로드할 수 있습니다.

gem install groupdocs_conversion_cloud

아래 언급된 단계를 따르기 전에 대시보드에서 클라이언트 ID 및 암호를 가져오십시오. ID와 시크릿이 있으면 애플리케이션에 아래 코드를 추가하여 아래와 같이 파워포인트를 두 개의 파일로 분할합니다.

# PowerPoint PPTX/PPT 슬라이드 스플리터 작동 방법
# http://api.groupdocs.cloud에 대한 Ruby 애플리케이션에서 gem https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby 로드
require 'groupdocs_merger_cloud'

# 무료 등록 후 https://dashboard.groupdocs.cloud에서 client_id 및 client_secret을 받으십시오.
@app_sid = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
@app_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Ruby에서 REST API를 사용하여 PPTX를 단일 슬라이드 파일로 분할

아래에 언급된 간단한 단계에 따라 클라우드에서 프로그래밍 방식으로 PowerPoint PPT/PPTX 슬라이드를 분할할 수 있습니다. 안내에 따라 PPTX 파일을 업로드한 다음 [다운로드](https://docs.groupdocs.cloud/merger/working- with-files/) REST API를 사용하여 클라우드에서 파일. 아래 단계에 따라 프로그래밍 방식으로 PPTX 파일의 페이지를 별도의 PowerPoint 슬라이드로 분할할 수 있습니다.

  • 먼저 DocumentApi의 인스턴스를 생성합니다.
  • 그런 다음 SplitOptions의 인스턴스를 만듭니다.
  • 이제 FileInfo의 인스턴스를 만듭니다.
  • 다음으로 입력 PowerPoint 파일의 경로를 설정합니다.
  • 그런 다음 FileInfo를 분할 옵션에 할당합니다.
  • 문서를 분할하려면 출력 경로와 특정 페이지 번호를 쉼표로 구분된 배열로 제공하십시오.
  • 이제 문서 분할 모드를 페이지로 설정합니다. API가 쉼표로 구분된 배열로 지정된 페이지 번호를 별도의 PowerPoint 슬라이드로 분할할 수 있습니다.
  • SplitOptions로 SplitRequest를 생성합니다.
  • 마지막으로 SplitRequest로 DocumentAPI.split() 메서드를 호출하고 결과를 얻습니다.

다음 코드 스니펫은 Ruby에서 REST API를 사용하여 PowerPoint 파일을 분할하는 방법을 보여줍니다.

# PPTX를 단일 슬라이드 파일로 분할하는 방법
# 문서 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.")

위의 코드 샘플은 분리된 단일 파일을 저장합니다.

Ruby에서 PowerPoint PPTX를 여러 슬라이드로 분리

아래 단계에 따라 프로그래밍 방식으로 PowerPoint 파일을 여러 페이지의 PowerPoint 슬라이드로 분할할 수 있습니다.

  • DocumentApi의 인스턴스를 생성합니다.
  • 이제 SplitOptions의 인스턴스를 만듭니다.
  • 다음으로 FileInfo의 인스턴스를 만듭니다.
  • 다음으로 입력 PPTX 파일의 경로를 설정합니다.
  • 그런 다음 FileInfo를 SplitOptions에 할당합니다.
  • 문서를 분할하려면 출력 경로와 특정 페이지 번호를 쉼표로 구분된 배열로 설정하십시오.
  • 이제 문서 분할 모드를 간격으로 설정합니다.
  • SplitOptions로 SplitRequest를 생성합니다.
  • 마지막으로 SplitRequest로 DocumentAPI.split() 메서드를 호출하고 결과를 얻습니다.

다음 코드 스니펫은 Ruby에서 REST API를 사용하여 PowerPoint 파일을 다중 페이지 PowerPoint 슬라이드로 분할하는 방법을 보여줍니다.

# PowerPoint를 여러 슬라이드 파일로 분할하는 방법
# 문서 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.")

Ruby에서 슬라이드 번호로 PowerPoint PPTX 중단

아래 단계에 따라 프로그래밍 방식으로 페이지 번호 범위를 제공하여 PowerPoint 파일에서 페이지를 추출하고 저장할 수 있습니다.

  • 먼저 DocumentApi의 인스턴스를 생성합니다.
  • 그런 다음 SplitOptions의 인스턴스를 만듭니다.
  • 이제 FileInfo의 인스턴스를 만듭니다.
  • 다음으로 입력 PPTX 파일의 경로를 설정합니다.
  • 그런 다음 FileInfo를 SplitOptions에 할당합니다.
  • 문서를 분할할 출력 경로, start\page\number 및 end\page\number를 설정합니다.
  • 이제 문서 분할 모드를 페이지로 설정합니다.
  • SplitOptions로 SplitRequest를 생성합니다.
  • 마지막으로 SplitRequest로 DocumentAPI.split() 메서드를 호출하고 결과를 얻습니다.

다음 코드 스니펫은 REST API를 사용하여 Ruby에서 정확한 페이지 번호로 PowerPoint 파일을 분할하는 방법을 보여줍니다.

# 페이지 번호로 PowerPoint PPTX를 분할하는 방법
# 문서 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.")

Ruby의 슬라이드 범위 모드로 PowerPoint PPTX 분할

아래 단계에 따라 프로그래밍 방식으로 페이지 번호 범위를 제공하여 PPTX 파일에서 페이지를 분리할 수 있습니다.

  • 먼저 DocumentApi의 인스턴스를 생성합니다.
  • 그런 다음 SplitOptions의 인스턴스를 만듭니다.
  • 이제 FileInfo의 인스턴스를 만듭니다.
  • 다음으로 입력 PowerPoint 슬라이드 파일의 경로를 설정합니다.
  • 그런 다음 FileInfo를 SplitOptions에 할당합니다.
  • 문서를 분할할 출력 경로, start\page\number 및 end\page\number를 설정합니다.
  • 이제 문서 범위\모드를 OddPages로 설정하고 분할 모드를 간격으로 설정합니다.
  • SplitOptions로 SplitRequest를 생성합니다.
  • 마지막으로 SplitRequest로 DocumentAPI.split() 메서드를 호출하고 결과를 얻습니다.

다음 코드 스니펫은 Ruby에서 REST API를 사용하여 필터를 적용하여 슬라이드 파일을 분할하는 방법을 보여줍니다.

# 페이지 범위로 PowerPoint PPTX를 분할하는 방법
# 문서 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.")

온라인 분할 PowerPoint 파일

PowerPoint 파일을 온라인으로 분할하는 방법? 무료 온라인 PPTX Splitter를 사용하여 PowerPoint 문서를 고정된 페이지 수 또는 다양한 페이지 범위로 여러 PPTX 슬라이드로 분할할 수 있습니다. 여러 페이지 PPTX 문서는 소스 문서의 레이아웃을 유지하면서 여러 PPTX 파일로 나뉩니다.

결론

이 자습서에서는 다음을 배웠습니다.

  • 클라우드의 Ruby에서 REST API를 사용하여 PPTX 파일을 분할하는 방법
  • 프로그래밍 방식으로 PPTX를 여러 슬라이드 파일로 분할하는 방법
  • Ruby를 사용하여 정확한 숫자로 PPTX 슬라이드를 추출합니다.
  • Ruby에서 슬라이드 범위 모드로 슬라이드를 분리합니다.

또한 문서를 사용하여 GroupDocs.Merger Cloud API에 대해 자세히 알아볼 수 있습니다. 또한 브라우저를 통해 직접 API를 시각화하고 통신할 수 있는 API 참조 섹션을 제공합니다.

질문하기

온라인에서 ppt를 여러 파일로 분할하거나 ppt에서 페이지를 추출하는 방법에 대해 질문이 있는 경우 포럼에서 언제든지 질문해 주세요.

또한보십시오