Open Source PHP Library for Converting Microsoft® Presentation Files
Convert Microsoft PowerPoint (PPTX, PPT) Presentation Files to PDF via Open Source Free PHP API
What is Gotenberg PHP Client?
The open-source API Gotenberg PHP Client allows PHP developers to convert Microsoft Presentations to PDF inside their own application. This is a simple, yet powerful feature to include in your application. You can not only convert your PPT and PPTX to PDF but can also merge one or more documents into a single PDF. The API is simple and lightweight and can be easily integrated into your applications.
Getting Started with Gotenberg PHP client
The recommended way Gotenberg PHP Client into your project is by using composer. Please use the following command for a smooth installation.
Install Gotenberg PHP Client via Composer
$ composer require thecodingmachine/gotenberg-php-client
Convert PPTX to PDF via Free PHP API
The free API Gotenberg PHP client allows PHP developers to convert PPT & PPTX documents into PDF inside their own applications. To merge and convert your PPTX to PDF, you just need to load your document and convert it using OfficeRequest() method. The following code snippet shows how to convert PPTX to PDF in PHP.
Free API to Convert PPTX to PDF in PHP
- Load PPTX file using DocumentFactory::makeFromPath() method and pass filename and file path as parameters
- Convert PPTX to PDF using OfficeRequest() method and pass file objects as parameter
- Save PDF document
How to Convert PPTX to PDF via Free PHP API?
$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
$file = [
DocumentFactory::makeFromPath('document.pptx', '/path/to/file')
];
$request = new OfficeRequest($file);
$dest = 'fileformat.pdf';
$client->store($request, $dest);