Wednesday, 19 September 2018

PhpPresentation imagecreatefromstring(): Data is not in a recognized format - PHP7.2

I am trying to use PhpPresentation to read a sample.pptx file using the simple instructions for readers in their docs and I am getting:

imagecreatefromstring(): Data is not in a recognized format

I have checked that I have PHP7.2-gd installed and all of the other dependencies.

My Code:

require_once 'vendor/autoload.php';

use \PhpOffice\PhpPresentation\PhpPresentation;
use \PhpOffice\PhpPresentation\IOFactory;
use \PhpOffice\PhpPresentation\Style\Color;
use \PhpOffice\PhpPresentation\Style\Alignment;

$oReader = IOFactory::createReader('PowerPoint2007');
$data = $oReader->load(__DIR__ . '/sample.pptx');
var_dump($data);

Can anybody help me understand the issue?



from PhpPresentation imagecreatefromstring(): Data is not in a recognized format - PHP7.2

No comments:

Post a Comment