Insert PDF into worksheet

Topics: User Forum
Jan 30, 2015 at 10:48 PM
Hi, Im trying to attach a PDF document into a worksheet, but I cant.
I already did it with an image using the next code:


<?php
require_once dirname(FILE) . '/Excel/Classes/PHPExcel.php';

$objPHPExcel = new PHPExcel();

$Image = imagecreatefromjpeg('image.jpg');
$objDrawing = new PHPExcel_Worksheet_MemoryDrawing();
$objDrawing->setName('Image');
$objDrawing->setDescription('Image');
$objDrawing->setImageResource($Image);
$objDrawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG);
$objDrawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);
$objDrawing->setHeight(150);
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save("image.xlsx");
?>


, but I want to add the PDF as an object in the worksheet, showing it as an icon,
is it possible?

Im using PHPExcel 1.8.0 in windows 7.

Thanks!