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.


Docs Swagger Examples Blog Support Release Notes Dashboard

Installation

The package is available at Packagist and it can be installed via Composer by executing following command:

composer require aspose/aspose-html-cloud-php

Packagist Version Packagist Downloads PHP-asposeCloud


Aspose.HTML Cloud SDK for PHP

The Aspose.HTML Cloud SDK for PHP allows your applications to work with HTML documents stored in the cloud. You can render HTML in its native form or convert it into multiple formats such as PDF, XPS, DOCX, JPEG, PNG, TIFF, BMP, GIF, Markdown, and MHTML.

In addition to document conversion, the API supports image vectorization, enabling you to transform raster images (JPEG, PNG, TIFF, BMP, GIF) into scalable SVG graphics for high-quality, resolution-independent output.


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

Features: Custom page size, margins, orientation, resolution, and cloud/local/URL input support.

Image Vectorization

  • Convert raster images (JPEG, PNG, TIFF, BMP, GIF) to scalable vector graphics SVG.
  • Create high-quality vector images even from low-resolution sources.
  • Adjust vectorization parameters such as error threshold, color limits, and line thickness to achieve precise results.
  • Process input from local files, URLs, or cloud storage.

Read & Write HTML Formats

HTML, XHTML, zipped HTML, zipped XHTML, MHTML, HTML containing SVG markup, Markdown, SVG

Save HTML As

Microsoft Word: DOCX
Fixed Layout: PDF, XPS
Images: JPEG, PNG, BMP, TIFF, GIF
Web Formats MHTML, Markdown

Read Formats

eBook: EPUB
Other: XML


Convert HTML to PDF Using Aspose.HTML Cloud SDK for PHP

This PHP example demonstrates how to use the Aspose.HTML Cloud SDK for PHP to convert an HTML file stored locally into a PDF file:

<?php
// Include the Composer autoload file to load Aspose.HTML Cloud SDK
require_once(__DIR__ . '/vendor/autoload.php');

// API configuration settings
$conf = array(
    "basePath" => "https://api.aspose.cloud/v4.0",
    "authPath" => "https://api.aspose.cloud/connect/token",
    "apiKey" => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "appSID" => "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "defaultUserAgent" => "Webkit"
);

// Initialize HtmlApi client with the configuration
$api_html = new Client\Invoker\Api\HtmlApi($conf);

// Define local input and output file paths
$src = 'input.html';    // Source HTML file
$dst = 'output.pdf';    // Destination PDF file

try {
    // Call the API to convert local HTML file to PDF
    $result = $api_html->convertLocalToLocal($src, $dst);

    // Print the result details (metadata about conversion or saved file)
    print_r($result);
} catch (Exception $e) {
    // Handle errors if API request fails
    echo 'Exception when calling HtmlApi->convertLocalToLocal: ', $e->getMessage(), PHP_EOL;
}
?>
 English