Trying to export image to PDF

Topics: Developer Forum, User Forum
Mar 24, 2015 at 9:46 PM
Hi,

I am trying to parse a small image from the working folder, add it into activesheet and trying to export as PDF alongwith other data. But its coming out as blank cell.

Following details:
PHPExcel v1.8.0 on PHP 5.3.3 over CENTOS 6.6

Image relevant code:

$gdImage = imagecreatefromjpeg('test.jpg');
$objDrawing = new PHPExcel_Worksheet_MemoryDrawing();
$objDrawing->setName('Sample image');
$objDrawing->setDescription('Sample image');
$objDrawing->setImageResource($gdImage);
$objDrawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG);
$objDrawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);
$objDrawing->setHeight(150);
$objDrawing->setCoordinates('D1');
$objDrawing->setWorksheet($phpExcel->getActiveSheet());

Using mPDF5.7 as rendering library.

The PDF output works fine for all other data, but image is not there in the configured cell.

Any help would be appreciated.

Regards,
Saad