Questions about how to export Image size settings in PHPExcel
Source: Internet
Author: User
When you use PHPExcel to export an image to excel, the image size is displayed only in a certain proportion and cannot be displayed according to your requirements, can someone help me? $ ObjDrawing = newPHPExcel_Worksheet_Drawing (); & nbsp; $ objDrawing-PHPExcel
When using PHPExcel to export an image to excel, the image size is only displayed in a certain proportion and cannot be displayed according to your own requirements. I don't know how to solve this problem. Can someone help me?
$ ObjDrawing = new PHPExcel_Worksheet_Drawing ();
$ ObjDrawing-> setName ('photo ');
$ ObjDrawing-> setDescription ('image inserted by pyxjm ');
$ ObjDrawing-> setPath ('.'. $ data ['lic _ litpic ']);
$ ObjDrawing-> setWidth ('122pt ');
$ ObjDrawing-> setHeight ('200pt ');
$ ObjDrawing-> setCoordinates ('G2 ');
$ ObjDrawing-> setOffsetX (2 );
$ ObjDrawing-> getShadow ()-> setVisible (true );
// $ ObjDrawing-> setMimeType (PHPExcel_Worksheet_MemoryDrawing: MIMETYPE_DEFAULT );
$ ObjDrawing-> setWorksheet ($ objPHPExcel-> getActiveSheet ());
------ Solution --------------------
$ ObjDrawing-> setHeight (122); // The Photo height.
$ ObjDrawing-> setWidth (200); // The Photo width.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service