Adding Image to the Excel in phpexcel in php

后端 未结 3 1475
慢半拍i
慢半拍i 2020-12-29 23:26

I am taking the example from phpexcel

I just tried with passing value in GET Method, I am done with that.

Now i am trying to add image in the a3 coloumn.

<
3条回答
  •  生来不讨喜
    2020-12-29 23:39

    I solve logo or images insert/showing problem use below code:

    $objDrawing = new PHPExcel_Worksheet_Drawing();
    $objDrawing->setName('test_img');
    $objDrawing->setDescription('test_img');
    $objDrawing->setPath('../images/logo.png');
    $objDrawing->setCoordinates('A1');                      
    //setOffsetX works properly
    $objDrawing->setOffsetX(5); 
    $objDrawing->setOffsetY(5);                
    //set width, height
    $objDrawing->setWidth(100); 
    $objDrawing->setHeight(35); 
    $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
    

提交回复
热议问题