Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to put the text below the image in the header or footer in phpExcel?

Tags:

php

phpexcel

Based on phpexcel_library/1.7.4/manual.html I can insert the text below the image, but is there a way to put text under the picture?

This is my code for the footer:

$workbook = new PHPExcel();

$objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing();
$objDrawing->setName('Footer Logo');
$objDrawing->setPath("footer_logo.png");
$objDrawing->setHeight(100);

$workbook->getActiveSheet()
    ->getHeaderFooter()
    ->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_FOOTER_CENTER);
$workbook->getActiveSheet()
    ->getHeaderFooter()
    ->setOddFooter('&G&CVisible text behind the transparent image.');
$workbook->getActiveSheet()
    ->getHeaderFooter()
    ->setEvenFooter('&G&CVisible text behind the transparent image.');
like image 435
simhumileco Avatar asked Sep 08 '16 12:09

simhumileco


People also ask

How do I insert a picture in the header and footer in Excel?

Go to Insert > Header or Footer > Blank. Double-click Type here in the header or footer area. Select Picture from File, choose your picture, and select Insert to add the picture.

How do I align an image in Excel header?

Click in the header or footer section where the image is located. Click in the &[Picture] text of the image. On the Design tab under Header & Footer Tools, click Format Picture in the Header & Footer Elements group. On the Size tab, adjust the size of the image to fit inside the header or footer section.

How do I change the header width in Excel?

To increase the width of multiple consecutive columns, select the columns you want to change. Click the header boundary of any selected column and drag to the right, like in the picture below. To decrease the width, drag to the left.


1 Answers

Try this , I am sure it will give you an idea about what you can do .

http://doclecture.net/1-57789.html

using setOddFooter($objDrawing ..... will give you the access to it.

like image 89
N.K Avatar answered Nov 14 '22 23:11

N.K