Browse our Products

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.

Aspose.HTML Cloud SDK for Ruby to Process HTML Files

You can easily use aspose_html_cloud for Ruby from RubyGems with the following command.

>


Aspose.HTML Cloud SDK for Ruby

Product Page | Documentation | Demos | Swagger UI | Examples | Blog | Search | Free Support | Free Trial

Aspose.HTML Cloud SDK for Ruby provides a robust solution for processing HTML documents. It acts as a Ruby wrapper around REST API, taking on numerous low-level operations: authentication, endpoint management, request/response handling, etc. This SDK is open source and has an MIT license. Currently, the Cloud SDK for Ruby offers a number of key features:

Convert HTML, MHTML, XHTML, EPUB, Markdown, and SVG

  • HTML & XHTML -> PDF, XPS, DOCX, MD, MHTML, JPEG, BMP, PNG, TIFF, GIF
  • EPUB -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF
  • MD -> PDF, XPS, DOCX, HTML, JPEG, BMP, PNG, TIFF, GIF
  • MHTML -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF
  • SVG -> PDF, XPS, JPEG, BMP, PNG, TIFF, GIF
  • Process input from local files, URLs, or cloud storage

HTML Files Cloud Storage Features

  • Upload, download, copy, move, and delete files with support for versioning (when supported by the storage provider, enabled by default).
  • Manage folders with options to create, copy, move, and delete.
  • Perform cross-storage operations by copying or moving files and folders between different storages in a single request.
  • Verify the existence of specific files, folders, or entire storages.

Image Vectorization

  • Convert raster images to SVG vector graphics.
  • Create high-quality vector images from low-resolution sources.
  • Fine-tune vectorization settings to achieve the desired level of detail and precision.
  • Process input from local files, URLs, or cloud storage.

Supported File Formats

Format  DescriptionLoadSave  Remarks
HTMLHTML format✔️✔️
XHTMLHTML with XML syntax✔️✔️Save option is only available when the input file is XHTML
MHTMLMHTML (Web archive) format✔️✔️Save option is only available for an MHTML document saving
EPUBE-book file format✔️
MDMarkdown Format✔️✔️Save option is only available for an HTML document saving
PDFSaves a document in PDF format✔️
XPSSaves a document in XPS (XML Paper Specification) format✔️
DOCXSaves a document in DOCX format✔️
TIFFRenders a page or pages of a document into TIFF✔️
JPEGRenders a page of a document and saves it as a JPEG file✔️
PNGRenders a page of a document and saves it as a PNG file✔️
BMPRenders a page of a document and saves it as a BMP file✔️
GIFRenders a page of a document and saves it as a GIF file✔️

Convert HTML to PDF

Use the Aspose.HTML Cloud SDK for Ruby to convert an HTML file stored locally into a PDF file.

# Load the Aspose.HTML Cloud SDK for Ruby
require 'aspose_html_cloud'

# Configuration with your Aspose Cloud credentials and API endpoints
CONFIG = {
    "basePath" => "https://api.aspose.cloud/v4.0",
    "authPath" => "https://api.aspose.cloud/connect/token",
    "apiKey"   => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "appSID"   => "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "debug"    => true
}

# Create an instance of the HtmlApi class using the configuration
api_instance = AsposeHtml::HtmlApi.new CONFIG

# Define the source (input) and destination (output) file paths
src = "test.html"  # Local HTML file to be converted
dst = "test.pdf"   # Path where the converted PDF will be saved

begin
  # Convert the local HTML file to a local PDF file
  result = api_instance.convert_local_to_local(src, dst)

  # Print the result (conversion details or success confirmation)
  p result
rescue AsposeHtml::ApiError => e
  # Handle exceptions and print error details
  puts "Exception when calling api_instance.convert_local_to_local: #{e}"
end
 English