ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter Class Reference

Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970:. More...

+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter:

Public Member Functions

 __construct ()
 Create a new HeaderFooter. More...
 
 getOddHeader ()
 Get OddHeader. More...
 
 setOddHeader ($pValue)
 Set OddHeader. More...
 
 getOddFooter ()
 Get OddFooter. More...
 
 setOddFooter ($pValue)
 Set OddFooter. More...
 
 getEvenHeader ()
 Get EvenHeader. More...
 
 setEvenHeader ($pValue)
 Set EvenHeader. More...
 
 getEvenFooter ()
 Get EvenFooter. More...
 
 setEvenFooter ($pValue)
 Set EvenFooter. More...
 
 getFirstHeader ()
 Get FirstHeader. More...
 
 setFirstHeader ($pValue)
 Set FirstHeader. More...
 
 getFirstFooter ()
 Get FirstFooter. More...
 
 setFirstFooter ($pValue)
 Set FirstFooter. More...
 
 getDifferentOddEven ()
 Get DifferentOddEven. More...
 
 setDifferentOddEven ($pValue)
 Set DifferentOddEven. More...
 
 getDifferentFirst ()
 Get DifferentFirst. More...
 
 setDifferentFirst ($pValue)
 Set DifferentFirst. More...
 
 getScaleWithDocument ()
 Get ScaleWithDocument. More...
 
 setScaleWithDocument ($pValue)
 Set ScaleWithDocument. More...
 
 getAlignWithMargins ()
 Get AlignWithMargins. More...
 
 setAlignWithMargins ($pValue)
 Set AlignWithMargins. More...
 
 addImage (HeaderFooterDrawing $image, $location=self::IMAGE_HEADER_LEFT)
 Add header/footer image. More...
 
 removeImage ($location=self::IMAGE_HEADER_LEFT)
 Remove header/footer image. More...
 
 setImages (array $images)
 Set header/footer images. More...
 
 getImages ()
 Get header/footer images. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 

Data Fields

const IMAGE_HEADER_LEFT = 'LH'
 
const IMAGE_HEADER_CENTER = 'CH'
 
const IMAGE_HEADER_RIGHT = 'RH'
 
const IMAGE_FOOTER_LEFT = 'LF'
 
const IMAGE_FOOTER_CENTER = 'CF'
 
const IMAGE_FOOTER_RIGHT = 'RF'
 

Private Attributes

 $oddHeader = ''
 
 $oddFooter = ''
 
 $evenHeader = ''
 
 $evenFooter = ''
 
 $firstHeader = ''
 
 $firstFooter = ''
 
 $differentOddEven = false
 
 $differentFirst = false
 
 $scaleWithDocument = true
 
 $alignWithMargins = true
 
 $headerFooterImages = []
 

Detailed Description

Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970:.

There are a number of formatting codes that can be written inline with the actual header / footer text, which affect the formatting in the header or footer.

Example: This example shows the text "Center Bold Header" on the first line (center section), and the date on the second line (center section). &CCenter &"-,Bold"Bold&"-,Regular"Header_x000A_&D

General Rules: There is no required order in which these codes must appear.

The first occurrence of the following codes turns the formatting ON, the second occurrence turns it OFF again:

  • strikethrough
  • superscript
  • subscript Superscript and subscript cannot both be ON at same time. Whichever comes first wins and the other is ignored, while the first is ON. &L - code for "left section" (there are three header / footer locations, "left", "center", and "right"). When two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the left section. &P - code for "current page #" &N - code for "total pages" &font size - code for "text font size", where font size is a font size in points. &K - code for "text font color" RGB Color is specified as RRGGBB Theme Color is specifed as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade value, NN is the tint/shade value. &S - code for "text strikethrough" on / off &X - code for "text super script" on / off &Y - code for "text subscript" on / off &C - code for "center section". When two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the center section.

&D - code for "date" &T - code for "time" &G - code for "picture as background" &U - code for "text single underline" &E - code for "double underline" &R - code for "right section". When two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the right section. &Z - code for "this workbook's file path" &F - code for "this workbook's file name" &A - code for "sheet tab name" &+ - code for add to page #. &- - code for subtract from page #. &"font name,font type" - code for "text font name" and "text font type", where font name and font type are strings specifying the name and type of the font, separated by a comma. When a hyphen appears in font name, it means "none specified". Both of font name and font type can be localized values. &"-,Bold" - code for "bold font style" &B - also means "bold font style". &"-,Regular" - code for "regular font style" &"-,Italic" - code for "italic font style" &I - also means "italic font style" &"-,Bold Italic" code for "bold italic font style" &O - code for "outline style" &H - code for "shadow style"

Definition at line 66 of file HeaderFooter.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::__construct ( )

Create a new HeaderFooter.

Definition at line 156 of file HeaderFooter.php.

157  {
158  }

Member Function Documentation

◆ __clone()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::__clone ( )

Implement PHP __clone to create a deep clone, not just a shallow copy.

Definition at line 479 of file HeaderFooter.php.

References $key.

480  {
481  $vars = get_object_vars($this);
482  foreach ($vars as $key => $value) {
483  if (is_object($value)) {
484  $this->$key = clone $value;
485  } else {
486  $this->$key = $value;
487  }
488  }
489  }
$key
Definition: croninfo.php:18

◆ addImage()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::addImage ( HeaderFooterDrawing  $image,
  $location = self::IMAGE_HEADER_LEFT 
)

Add header/footer image.

Parameters
string$location
Returns
$this

Definition at line 407 of file HeaderFooter.php.

References $location.

408  {
409  $this->headerFooterImages[$location] = $image;
410 
411  return $this;
412  }
$location
Definition: buildRTE.php:44

◆ getAlignWithMargins()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getAlignWithMargins ( )

Get AlignWithMargins.

Returns
bool

Definition at line 381 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$alignWithMargins.

◆ getDifferentFirst()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getDifferentFirst ( )

Get DifferentFirst.

Returns
bool

Definition at line 333 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$differentFirst.

◆ getDifferentOddEven()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getDifferentOddEven ( )

Get DifferentOddEven.

Returns
bool

Definition at line 309 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$differentOddEven.

◆ getEvenFooter()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getEvenFooter ( )

Get EvenFooter.

Returns
string

Definition at line 237 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$evenFooter.

◆ getEvenHeader()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getEvenHeader ( )

Get EvenHeader.

Returns
string

Definition at line 213 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$evenHeader.

◆ getFirstFooter()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getFirstFooter ( )

Get FirstFooter.

Returns
string

Definition at line 285 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$firstFooter.

◆ getFirstHeader()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getFirstHeader ( )

Get FirstHeader.

Returns
string

Definition at line 261 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$firstHeader.

◆ getImages()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getImages ( )

Get header/footer images.

Returns
HeaderFooterDrawing[]

Definition at line 449 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$headerFooterImages.

450  {
451  // Sort array
452  $images = [];
453  if (isset($this->headerFooterImages[self::IMAGE_HEADER_LEFT])) {
454  $images[self::IMAGE_HEADER_LEFT] = $this->headerFooterImages[self::IMAGE_HEADER_LEFT];
455  }
456  if (isset($this->headerFooterImages[self::IMAGE_HEADER_CENTER])) {
457  $images[self::IMAGE_HEADER_CENTER] = $this->headerFooterImages[self::IMAGE_HEADER_CENTER];
458  }
459  if (isset($this->headerFooterImages[self::IMAGE_HEADER_RIGHT])) {
460  $images[self::IMAGE_HEADER_RIGHT] = $this->headerFooterImages[self::IMAGE_HEADER_RIGHT];
461  }
462  if (isset($this->headerFooterImages[self::IMAGE_FOOTER_LEFT])) {
463  $images[self::IMAGE_FOOTER_LEFT] = $this->headerFooterImages[self::IMAGE_FOOTER_LEFT];
464  }
465  if (isset($this->headerFooterImages[self::IMAGE_FOOTER_CENTER])) {
466  $images[self::IMAGE_FOOTER_CENTER] = $this->headerFooterImages[self::IMAGE_FOOTER_CENTER];
467  }
468  if (isset($this->headerFooterImages[self::IMAGE_FOOTER_RIGHT])) {
469  $images[self::IMAGE_FOOTER_RIGHT] = $this->headerFooterImages[self::IMAGE_FOOTER_RIGHT];
470  }
471  $this->headerFooterImages = $images;
472 
474  }

◆ getOddFooter()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getOddFooter ( )

Get OddFooter.

Returns
string

Definition at line 189 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$oddFooter.

◆ getOddHeader()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getOddHeader ( )

Get OddHeader.

Returns
string

Definition at line 165 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$oddHeader.

◆ getScaleWithDocument()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::getScaleWithDocument ( )

Get ScaleWithDocument.

Returns
bool

Definition at line 357 of file HeaderFooter.php.

References PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter\$scaleWithDocument.

◆ removeImage()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::removeImage (   $location = self::IMAGE_HEADER_LEFT)

Remove header/footer image.

Parameters
string$location
Returns
$this

Definition at line 421 of file HeaderFooter.php.

References $location.

422  {
423  if (isset($this->headerFooterImages[$location])) {
424  unset($this->headerFooterImages[$location]);
425  }
426 
427  return $this;
428  }
$location
Definition: buildRTE.php:44

◆ setAlignWithMargins()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setAlignWithMargins (   $pValue)

Set AlignWithMargins.

Parameters
bool$pValue
Returns
$this

Definition at line 393 of file HeaderFooter.php.

394  {
395  $this->alignWithMargins = $pValue;
396 
397  return $this;
398  }

◆ setDifferentFirst()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setDifferentFirst (   $pValue)

Set DifferentFirst.

Parameters
bool$pValue
Returns
$this

Definition at line 345 of file HeaderFooter.php.

346  {
347  $this->differentFirst = $pValue;
348 
349  return $this;
350  }

◆ setDifferentOddEven()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setDifferentOddEven (   $pValue)

Set DifferentOddEven.

Parameters
bool$pValue
Returns
$this

Definition at line 321 of file HeaderFooter.php.

322  {
323  $this->differentOddEven = $pValue;
324 
325  return $this;
326  }

◆ setEvenFooter()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setEvenFooter (   $pValue)

Set EvenFooter.

Parameters
string$pValue
Returns
$this

Definition at line 249 of file HeaderFooter.php.

250  {
251  $this->evenFooter = $pValue;
252 
253  return $this;
254  }

◆ setEvenHeader()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setEvenHeader (   $pValue)

Set EvenHeader.

Parameters
string$pValue
Returns
$this

Definition at line 225 of file HeaderFooter.php.

226  {
227  $this->evenHeader = $pValue;
228 
229  return $this;
230  }

◆ setFirstFooter()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setFirstFooter (   $pValue)

Set FirstFooter.

Parameters
string$pValue
Returns
$this

Definition at line 297 of file HeaderFooter.php.

298  {
299  $this->firstFooter = $pValue;
300 
301  return $this;
302  }

◆ setFirstHeader()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setFirstHeader (   $pValue)

Set FirstHeader.

Parameters
string$pValue
Returns
$this

Definition at line 273 of file HeaderFooter.php.

274  {
275  $this->firstHeader = $pValue;
276 
277  return $this;
278  }

◆ setImages()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setImages ( array  $images)

Set header/footer images.

Parameters
HeaderFooterDrawing[]$images
Returns
$this

Definition at line 437 of file HeaderFooter.php.

438  {
439  $this->headerFooterImages = $images;
440 
441  return $this;
442  }

◆ setOddFooter()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setOddFooter (   $pValue)

Set OddFooter.

Parameters
string$pValue
Returns
$this

Definition at line 201 of file HeaderFooter.php.

202  {
203  $this->oddFooter = $pValue;
204 
205  return $this;
206  }

◆ setOddHeader()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setOddHeader (   $pValue)

Set OddHeader.

Parameters
string$pValue
Returns
$this

Definition at line 177 of file HeaderFooter.php.

178  {
179  $this->oddHeader = $pValue;
180 
181  return $this;
182  }

◆ setScaleWithDocument()

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::setScaleWithDocument (   $pValue)

Set ScaleWithDocument.

Parameters
bool$pValue
Returns
$this

Definition at line 369 of file HeaderFooter.php.

370  {
371  $this->scaleWithDocument = $pValue;
372 
373  return $this;
374  }

Field Documentation

◆ $alignWithMargins

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$alignWithMargins = true
private

◆ $differentFirst

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$differentFirst = false
private

◆ $differentOddEven

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$differentOddEven = false
private

◆ $evenFooter

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$evenFooter = ''
private

◆ $evenHeader

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$evenHeader = ''
private

◆ $firstFooter

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$firstFooter = ''
private

◆ $firstHeader

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$firstHeader = ''
private

◆ $headerFooterImages

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$headerFooterImages = []
private

◆ $oddFooter

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$oddFooter = ''
private

◆ $oddHeader

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$oddHeader = ''
private

◆ $scaleWithDocument

PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::$scaleWithDocument = true
private

◆ IMAGE_FOOTER_CENTER

const PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_FOOTER_CENTER = 'CF'

Definition at line 73 of file HeaderFooter.php.

◆ IMAGE_FOOTER_LEFT

const PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_FOOTER_LEFT = 'LF'

Definition at line 72 of file HeaderFooter.php.

◆ IMAGE_FOOTER_RIGHT

const PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_FOOTER_RIGHT = 'RF'

Definition at line 74 of file HeaderFooter.php.

◆ IMAGE_HEADER_CENTER

const PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_HEADER_CENTER = 'CH'

Definition at line 70 of file HeaderFooter.php.

◆ IMAGE_HEADER_LEFT

const PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_HEADER_LEFT = 'LH'

Definition at line 69 of file HeaderFooter.php.

◆ IMAGE_HEADER_RIGHT

const PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_HEADER_RIGHT = 'RH'

Definition at line 71 of file HeaderFooter.php.


The documentation for this class was generated from the following file: