Quantcast
Channel: PHPExcel Forum Rss Feed
Viewing all articles
Browse latest Browse all 2707

New Post: Insert image from Url

$
0
0
Images in Excel are overlaid on the worksheet: either linked over a single (top-left) cell, with a height and width; or to two cells (top-left and bottom-right). In most cases with PHPExcel, we use the single anchor method
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing->setName('PHPExcel logo');
$objDrawing->setDescription('PHPExcel logo');
$objDrawing->setPath('./images/phpexcel_logo.gif');       // filesystem reference for the image file
$objDrawing->setHeight(36);                 // sets the image height to 36px (overriding the actual image height); 
$objDrawing->setCoordinates('D24');    // pins the top-left corner of the image to cell D24
$objDrawing->setOffsetX(10);                // pins the top left corner of the image at an offset of 10 points horizontally to the right of the top-left corner of the cell
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());

Viewing all articles
Browse latest Browse all 2707

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>