Reputation: 913
I try to generate a thumbnail for a PPSX
file, I do it with pdf files and it works perfectly using Spatie\PdfToImage
library.
I search a lot about PPSX
version but there's no library to do it.
I try to convert PPSX
to a pdf
using PHP
file but with the same issue, no solution on the internet.
is there any solution to do it?
Upvotes: 0
Views: 189
Reputation: 67
You can use Aspose.Slides Cloud SDK for PHP to convert a Slide Show file and other presentation files to images and many other formats. The following code example shows you how to convert slides from a PPSX
file to PNG
images:
use Aspose\Slides\Cloud\Sdk\Api\Configuration;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi;
$configuration = new Configuration();
$configuration->setAppSid("my_client_id");
$configuration->setAppKey("my_client_key");
$slidesApi = new SlidesApi(null, $configuration);
// Open a Slide Show file.
$fileStream = fopen("example.ppsx", 'r');
// Select slides to convert to images (all slides by default).
$slideIndices = array(1, 3);
// Convert the slides to PNG images, for example.
$response = $slidesApi->convert($fileStream, "png", null, null, null, $slideIndices);
// Save the result (zip file with the images) to a local file path.
$fileSize = $response->getSize();
$contents = $response->fread($fileSize);
file_put_contents("example_images.zip", $contents);
Sometimes it is necessary to convert a presentation to another format without any code. In such a case, you can use the Online Presentation Converter.
I work as a Support Developer at Aspose.
Upvotes: 1