Free Support Forum -

Convert PowerPoint Presentation Slide to HTML in PHP with Aspose.Slides REST API


I tried to convert a basic PPTX file to HTML with the PDF SDK and it’s returning me an empty HTML.


<!DOCTYPE html><html><head><title></title></head><body><?xml version="1.0" encoding="utf-8" standalone="yes"?>

Code is very basic for now:

    $request = new Aspose\Slides\Cloud\Sdk\Model\Requests\GetSlideWithFormatRequest('sample.pptx', 1, 'html');
    $config = new Aspose\Slides\Cloud\Sdk\Api\Configuration();
    $slidesApi = new Aspose\Slides\Cloud\Sdk\Api\SlidesApi(null, $config);
    $result = $slidesApi->GetSlideWithFormat($request);

sample.pptx file is well found; i did upload it manually in the backend (because the Utils.php file is nowhere; will have to make a cURL request to post the file…). But the returned HTML is empty here…

Here is the PPTX file. (209.5 KB)

If someone has any idea ? Or i will look for another provider; just started my test and nothing is working as expected :frowning:


Thanks for your inquiry. Please check following PHP code snippet, to upload PPTX file to storage and convert the specific slide to HTML (4.6 KB). Hopefully it will help you to accomplish the task.

Furthermore, you can check the github repo of Aspose.Slides Cloud SDK for PHP for more examples.


//TODO: Get your AppSID and AppKey at (free registration is required).


$configuration = new Aspose\Slides\Cloud\Sdk\Api\Configuration();

$slidesApi = new Aspose\Slides\Cloud\Sdk\Api\SlidesApi(null,$configuration); 

$storageApi = new Aspose\Storage\Api\StorageApi();

try {
	$testname = "sample.pptx";
	$testslideIndex =1;
	$file = "D:/Downloads/sample.pptx/".$testname;
	$version_id = null;
    $storage = null;
	$putRequest = new Aspose\Storage\Model\Requests\PutCreateRequest($testname, $file, $version_id, $storage);
	$request = new Aspose\Slides\Cloud\Sdk\Model\Requests\GetSlideWithFormatRequest($testname, $testslideIndex, $testformat, $testwidth, $testheight, $testpassword, $testfolder, $teststorage, $testoutPath, $testfontsFolder);
    $response = $slidesApi->getSlideWithFormat($request);
    echo "Done....";
} catch (Exception $e) {
    echo  "Something went wrong: ",  $e->getMessage(), "\n";