1. Products
  2.   HTML
  3.   Ruby
  4.   Aspose.HTML Cloud SDK for Ruby

Aspose.HTML Cloud SDK for Ruby


Powerful Ruby SDK to Create, Extract & Process HTML Files

Advanced Ruby Cloud SDK that allows Software Developers to Create, Parse, Manipulate and Convert HTML files to EPUB, PDF, XPS, DOCX, DOC, PNG, JPEG, BMP, TIFF & more.

In today's digital age, manipulating and converting HTML documents and web pages programmatically is a common necessity for many developers. Aspose.HTML Cloud SDK for Rubyoffers a powerful solution to accomplish these tasks seamlessly in the Ruby programming language. It provides software developers with a wide range of HTML document manipulation capabilities, including HTML-to-PDF conversion, HTML-to-Image conversion, HTML validation, and much more. Aspose.HTML Cloud SDK for Ruby serves as a bridge between your Ruby applications and the Aspose.HTML Cloud service, making it easier for you to integrate these powerful features into your projects.

Aspose.HTML Cloud SDK for Ruby is a part of the Aspose.HTML Cloud family, which is a collection of cloud-based APIs and SDKs designed to work with HTML files. There are several important features part of the library such as, creating new HTML documents from scratch, converting HTML documents to PDF and other supported file formats, exporting HTML pages or sections to image formats, HTML documents validation, Extract structured data from HTML documents, Render HTML documents as images, and many more. The SDK can seamlessly integrate with popular cloud storage providers like Amazon S3 and Microsoft Azure, making it easy to store and manage your HTML documents.

Aspose.HTML Cloud SDK for Ruby prioritizes the security of your data. It uses secure connections and authentication methods to safeguard your HTML documents and their contents. It simplifies HTML document manipulation and processing tasks, allowing software developers to automate various aspects of working with HTML content. Whether you're building web applications, automating business processes, or extracting data from the web, this SDK provides the tools you need to streamline your HTML-related tasks. By harnessing the power of Aspose.HTML Cloud and the convenience of Ruby, you can enhance your development projects and deliver high-quality HTML processing capabilities to your users.

Previous Next

Getting Started with Aspose.HTML Cloud SDK for Ruby

The recommend way to install Aspose.HTML Cloud SDK for Ruby via RubyGems, the dependency management tool for Ruby. Please use the following command a smooth installation.

Install Aspose.HTML Cloud SDK for Ruby via RubyGems

 gem install aspose_html_cloud

You can download the library directly from Aspose.HTML Cloud SDK for Ruby product page

Export HTML to PDF via Ruby API

One of the core functionalities of Aspose.HTML Cloud SDK for Ruby is its ability to convert HTML documents to PDF files with ease. This feature is particularly useful for generating printable reports, invoices, saving web pages as PDFs, creating digital documents and more from web content. The library supports HTML documents conversion to some leading file formats like PDFs, XPS, DOC, DOCX, MHTML and many more. The following example demonstrates how with just a couple of lines Ruby code software developers to achieve the conversion from HTML to PDF and other file formats.

How to Convert HTML to PDF using Ruby SDK?

// Initialize SDK API

var api = new HtmlApi("CLIENT_ID", "CLIENT_SECRET").ConvertApi;

// Convert HTML to PDF

var result = await api.ConvertAsync("test.html", "test.pdf");

HTML Validation & Manipulation via Ruby

Aspose.HTML Cloud SDK for Ruby helps software developers to validate their HTML documents to ensure they comply with web standards and identify any issues in the markup inside Ruby applications. It allows users to validate HTML documents against different HTML specifications and standards, ensuring the quality and correctness of your HTML content. The SDK also enables software developers to programmatically edit and manipulate HTML documents, such as adding or removing elements, updating attributes, and more.

EPUB to XPS, DOCX & Image Conversion

Aspose.HTML Cloud SDK for Ruby allows software developers to load and convert HTML documents to EPUB file formats with just a couple of lines to Ruby code. The library also included support for converting EPUB files to PDF, XPS, DOC/DOCX and popular image file formats like JPEG, PNG, GIF, TIFF, BMP and so on. The following example shows how software developers can Convert EPUB file from the local file system to PNG file formats using Ruby code.

How to Convert EPUB file from the local file system to PNG via Ruby SDK?

# load the gem

require 'aspose_html_cloud'

# Get keys from aspose site.

# There is free quota available. 

# For more details, see https://purchase.aspose.cloud/pricing




api_instance = AsposeHtml::HtmlApi.new CONFIG
src = "test.epub" # String | Source file.
dst = "test.png"  # String | Result file.

opts = { 

  width: 700,       # Float | Resulting image width in pixels. 
  height: 1000,     # Float | Resulting image height in pixels. 
  left_margin: 40,  # Float | Left resulting image margin in pixels.
  right_margin: 40, # Float | Right resulting image margin in pixels.
  top_margin: 50,   # Float | Top resulting image margin in pixels.
  bottom_margin: 50 # Float | Bottom resulting image margin in pixels.



  #Convert the HTML file from the local file and save result to the local file.
  result = api_instance.convert_local_to_local(src, dst, opts)
  p result

rescue AsposeHtml::ApiError => e
  puts "Exception when calling api_instance.convert_local_to_local: #{e}"