1. Products
  2.   Word Processing
  3.   Ruby
  4.   Aspose.Words Cloud Ruby SDK

Aspose.Words Cloud Ruby SDK

 
 

Ruby SDK to Create & Convert MS Word Documents

A Leading Ruby Cloud API to Generate, Edit, Split, Merge, Manipulate, and Convert Word (DOC, DOCX, ODT) to PDF, HTML, EPUB, images & many more.

What is Aspose.Words Cloud SDK for Ruby?

Aspose.Words Cloud SDK for Ruby is a robust Ruby word processing API that empowers software developers to handle Microsoft Word documents directly in the cloud. Built on the reliable Aspose.Words Cloud REST API, it enables developers to create new Word documents via Ruby, modify existing Word files, and perform Word DOCX conversion online without relying on Microsoft Word. The SDK is ideal for cloud-based document processing, offering seamless integration into Ruby applications for a wide range of document automation tasks, including content updates and format conversions.

The versatile Ruby SDK simplifies document automation by enabling cloud-based manipulation without the need for Microsoft Office, making it an ideal Ruby office automation API for modern applications. It allows software developers to edit Word documents with ease, merge or split files, insert images and graphics, and work with tables in Word files effortlessly. It supports secure operations like password protection and document encryption, along with Mail Merge and comparison features. The SDK offers high-fidelity support for various file formats including DOCX, PDF, HTML, RTF, and more, making Ruby DOCX to PDF API tasks smooth and efficient. From managing headers and footers to automating entire workflows, it’s a complete solution for converting Word documents in Ruby with ease and precision.

Previous Next

Getting Started with Aspose.Words Cloud SDK for Ruby

The recommend way to install Aspose.Words Cloud SDK for Rubyis using RubyGem. Please use the following command for a smooth installation.

Install Aspose.Words Cloud SDK for Ruby via RubyGem


//To install this package do the following: update your Gemfile
gem 'aspose_words_cloud', '~> 23.2'
// or install directly
gem install aspose_words_cloud
 
You can also download it directly from GitHub.

Word Documents Generation via Ruby Cloud API

Aspose.Words Cloud SDK for Ruby gives software programmers the capability to generate new Microsoft Word and OpenOffice documents without installing Microsoft Office. It can create Word files in DOC, DOCX, RTF, DOT, DOTX, DOTM, FlatOPC (XML), and more. The library has included various features for handling Word document creation and management, such as Inserting new pages, adding watermarks in Word documents, Inserting a page number field, adding and manging tables, inserting text to Word documents, document & text classifications, and many more.

How to Create a New Word Document in Python Applications?

 

require 'aspose_words_cloud'
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = '####-####-####-####-####'
config.client_data['ClientSecret'] = '##################'
end

@words_api = WordsAPI.new

create_request = CreateDocumentRequest.new(file_name: 'Sample.docx')
@words_api.create_document(create_request)

Convert Word Documents via Ruby API

Aspose.Words Cloud SDK for Ruby has provided a very powerful feature for converting Word documents to various other supported file formats using RESTAPIs. The library has provided support for importing and exporting documents to some popular file formats like DOC, DOCX, PDF, RTF, DOT, DOTX, ODT, OTT, HTML, MHTML, XML, and TXT. Developers can also export-only Word documents to file formats like PS, XPS, OpenXPS, PNG, JPEG, BMP, SVG, TIFF, EMF, PCL, EPUB, and many more. The following example demonstrates how programmatically software developers can convert Word to PDF.

How to Convert Word to PDF via Ruby API?

 
require 'aspose_words_cloud'
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = '####-####-####-####-####'
config.client_data['ClientSecret'] = '##################'
end

@words_api = WordsAPI.new
request_document = File.open('Sample.docx')
convert_request = ConvertDocumentRequest.new(document: request_document, format: 'pdf')
@words_api.convert_document(convert_request)

Manage Headers/Footers & Hyperlinks via Python API

Aspose.Words Cloud SDK gives software developers ability to manage Headers and Footers inside word documents using Python commands. The library has included supports for inserting a Header/Footer into a Word document, update content of headers/footers, get a Header/Footer of a Word document as well as of a section, link headers/footers of a section to the previous one, delete a `HeaderFooter` object from a Word document online and many more. Developers also add, delete and get hyperlinks from word documents with ease.

How to Insert Headers/Footers into Word Document via Python API?

import os

import asposewordscloud
import asposewordscloud.models.requests
from asposewordscloud.rest import ApiException
from shutil import copyfile
words_api = WordsApi(client_id = '####-####-####-####-####', client_secret = '##################') 
request_document = open('Sample.doc', 'rb')
insert_request = asposewordscloud.models.requests.InsertHeaderFooterOnlineRequest(document=request_document, section_path='', header_footer_type='FooterEven')
words_api.insert_header_footer_online(insert_request)

Word Documents Protection in Ruby Applications

Aspose.Words Cloud SDK for Ruby makes it easy for software developers to secure and protect Word documents inside their own Ruby applications. The library has included various features for handling Documents protection, such as adding protection to Word documents, restricting documents editing, encrypting word documents with Password, adding a Digital Signature, and many more. The following example demonstrates how to add protection to a Word document in Cloud. 

How to Add Protection to Word Documents via Cloud API?

require 'aspose_words_cloud'
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = '####-####-####-####-####'
config.client_data['ClientSecret'] = '##################'
end

@words_api = WordsAPI.new
request_document = File.open('Sample.docx')
request_protection_request = ProtectionRequest.new({:NewPassword => '123'})
protect_request = ProtectDocumentOnlineRequest.new(document: request_document, protection_request: request_protection_request)
@words_api.protect_document_online(protect_request)

Merge & Split Word Documents via Ruby API

Aspose.Words Cloud SDK for Ruby has included complete support for splitting and merging Word documents inside their own Ruby applications. The library has included support for merging several Word or PDF documents into a single document with just a couple of lines of code. The library can also Split large documents, split specific Word pages to PDFs or any other support file formats, such as DOC, DOT, DOCX, DOTX, RTF, ODT, OTT, TXT documents, and save the results to DOC, DOCX, PDF, ODT, RTF, HTML, JPEG, PNG, and many other file formats. 

How to Split DOCX to PDFs via Ruby Library?

require 'aspose_words_cloud'
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = '####-####-####-####-####'
config.client_data['ClientSecret'] = '##################'

end

@words_api = WordsAPI.new
request_document = File.open('Sample.docx')
split_request = SplitDocumentOnlineRequest.new(document: request_document, format: 'text', dest_file_name: 'SplitDocument.text', from: 1, to: 2)
@words_api.split_document_online(split_request)

 English