5 * Copyright (c) 2006 - 2014 PHPExcel
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 * @package PHPExcel_Worksheet
23 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 * @version ##VERSION##, ##DATE##
30 * PHPExcel_Worksheet_PageSetup
33 * Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988:
35 * 1 = Letter paper (8.5 in. by 11 in.)
36 * 2 = Letter small paper (8.5 in. by 11 in.)
37 * 3 = Tabloid paper (11 in. by 17 in.)
38 * 4 = Ledger paper (17 in. by 11 in.)
39 * 5 = Legal paper (8.5 in. by 14 in.)
40 * 6 = Statement paper (5.5 in. by 8.5 in.)
41 * 7 = Executive paper (7.25 in. by 10.5 in.)
42 * 8 = A3 paper (297 mm by 420 mm)
43 * 9 = A4 paper (210 mm by 297 mm)
44 * 10 = A4 small paper (210 mm by 297 mm)
45 * 11 = A5 paper (148 mm by 210 mm)
46 * 12 = B4 paper (250 mm by 353 mm)
47 * 13 = B5 paper (176 mm by 250 mm)
48 * 14 = Folio paper (8.5 in. by 13 in.)
49 * 15 = Quarto paper (215 mm by 275 mm)
50 * 16 = Standard paper (10 in. by 14 in.)
51 * 17 = Standard paper (11 in. by 17 in.)
52 * 18 = Note paper (8.5 in. by 11 in.)
53 * 19 = #9 envelope (3.875 in. by 8.875 in.)
54 * 20 = #10 envelope (4.125 in. by 9.5 in.)
55 * 21 = #11 envelope (4.5 in. by 10.375 in.)
56 * 22 = #12 envelope (4.75 in. by 11 in.)
57 * 23 = #14 envelope (5 in. by 11.5 in.)
58 * 24 = C paper (17 in. by 22 in.)
59 * 25 = D paper (22 in. by 34 in.)
60 * 26 = E paper (34 in. by 44 in.)
61 * 27 = DL envelope (110 mm by 220 mm)
62 * 28 = C5 envelope (162 mm by 229 mm)
63 * 29 = C3 envelope (324 mm by 458 mm)
64 * 30 = C4 envelope (229 mm by 324 mm)
65 * 31 = C6 envelope (114 mm by 162 mm)
66 * 32 = C65 envelope (114 mm by 229 mm)
67 * 33 = B4 envelope (250 mm by 353 mm)
68 * 34 = B5 envelope (176 mm by 250 mm)
69 * 35 = B6 envelope (176 mm by 125 mm)
70 * 36 = Italy envelope (110 mm by 230 mm)
71 * 37 = Monarch envelope (3.875 in. by 7.5 in.).
72 * 38 = 6 3/4 envelope (3.625 in. by 6.5 in.)
73 * 39 = US standard fanfold (14.875 in. by 11 in.)
74 * 40 = German standard fanfold (8.5 in. by 12 in.)
75 * 41 = German legal fanfold (8.5 in. by 13 in.)
76 * 42 = ISO B4 (250 mm by 353 mm)
77 * 43 = Japanese double postcard (200 mm by 148 mm)
78 * 44 = Standard paper (9 in. by 11 in.)
79 * 45 = Standard paper (10 in. by 11 in.)
80 * 46 = Standard paper (15 in. by 11 in.)
81 * 47 = Invite envelope (220 mm by 220 mm)
82 * 50 = Letter extra paper (9.275 in. by 12 in.)
83 * 51 = Legal extra paper (9.275 in. by 15 in.)
84 * 52 = Tabloid extra paper (11.69 in. by 18 in.)
85 * 53 = A4 extra paper (236 mm by 322 mm)
86 * 54 = Letter transverse paper (8.275 in. by 11 in.)
87 * 55 = A4 transverse paper (210 mm by 297 mm)
88 * 56 = Letter extra transverse paper (9.275 in. by 12 in.)
89 * 57 = SuperA/SuperA/A4 paper (227 mm by 356 mm)
90 * 58 = SuperB/SuperB/A3 paper (305 mm by 487 mm)
91 * 59 = Letter plus paper (8.5 in. by 12.69 in.)
92 * 60 = A4 plus paper (210 mm by 330 mm)
93 * 61 = A5 transverse paper (148 mm by 210 mm)
94 * 62 = JIS B5 transverse paper (182 mm by 257 mm)
95 * 63 = A3 extra paper (322 mm by 445 mm)
96 * 64 = A5 extra paper (174 mm by 235 mm)
97 * 65 = ISO B5 extra paper (201 mm by 276 mm)
98 * 66 = A2 paper (420 mm by 594 mm)
99 * 67 = A3 transverse paper (297 mm by 420 mm)
100 * 68 = A3 extra transverse paper (322 mm by 445 mm)
104 * @package PHPExcel_Worksheet
105 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
107 class PHPExcel_Worksheet_PageSetup
110 const PAPERSIZE_LETTER
= 1;
111 const PAPERSIZE_LETTER_SMALL
= 2;
112 const PAPERSIZE_TABLOID
= 3;
113 const PAPERSIZE_LEDGER
= 4;
114 const PAPERSIZE_LEGAL
= 5;
115 const PAPERSIZE_STATEMENT
= 6;
116 const PAPERSIZE_EXECUTIVE
= 7;
117 const PAPERSIZE_A3
= 8;
118 const PAPERSIZE_A4
= 9;
119 const PAPERSIZE_A4_SMALL
= 10;
120 const PAPERSIZE_A5
= 11;
121 const PAPERSIZE_B4
= 12;
122 const PAPERSIZE_B5
= 13;
123 const PAPERSIZE_FOLIO
= 14;
124 const PAPERSIZE_QUARTO
= 15;
125 const PAPERSIZE_STANDARD_1
= 16;
126 const PAPERSIZE_STANDARD_2
= 17;
127 const PAPERSIZE_NOTE
= 18;
128 const PAPERSIZE_NO9_ENVELOPE
= 19;
129 const PAPERSIZE_NO10_ENVELOPE
= 20;
130 const PAPERSIZE_NO11_ENVELOPE
= 21;
131 const PAPERSIZE_NO12_ENVELOPE
= 22;
132 const PAPERSIZE_NO14_ENVELOPE
= 23;
133 const PAPERSIZE_C
= 24;
134 const PAPERSIZE_D
= 25;
135 const PAPERSIZE_E
= 26;
136 const PAPERSIZE_DL_ENVELOPE
= 27;
137 const PAPERSIZE_C5_ENVELOPE
= 28;
138 const PAPERSIZE_C3_ENVELOPE
= 29;
139 const PAPERSIZE_C4_ENVELOPE
= 30;
140 const PAPERSIZE_C6_ENVELOPE
= 31;
141 const PAPERSIZE_C65_ENVELOPE
= 32;
142 const PAPERSIZE_B4_ENVELOPE
= 33;
143 const PAPERSIZE_B5_ENVELOPE
= 34;
144 const PAPERSIZE_B6_ENVELOPE
= 35;
145 const PAPERSIZE_ITALY_ENVELOPE
= 36;
146 const PAPERSIZE_MONARCH_ENVELOPE
= 37;
147 const PAPERSIZE_6_3_4_ENVELOPE
= 38;
148 const PAPERSIZE_US_STANDARD_FANFOLD
= 39;
149 const PAPERSIZE_GERMAN_STANDARD_FANFOLD
= 40;
150 const PAPERSIZE_GERMAN_LEGAL_FANFOLD
= 41;
151 const PAPERSIZE_ISO_B4
= 42;
152 const PAPERSIZE_JAPANESE_DOUBLE_POSTCARD
= 43;
153 const PAPERSIZE_STANDARD_PAPER_1
= 44;
154 const PAPERSIZE_STANDARD_PAPER_2
= 45;
155 const PAPERSIZE_STANDARD_PAPER_3
= 46;
156 const PAPERSIZE_INVITE_ENVELOPE
= 47;
157 const PAPERSIZE_LETTER_EXTRA_PAPER
= 48;
158 const PAPERSIZE_LEGAL_EXTRA_PAPER
= 49;
159 const PAPERSIZE_TABLOID_EXTRA_PAPER
= 50;
160 const PAPERSIZE_A4_EXTRA_PAPER
= 51;
161 const PAPERSIZE_LETTER_TRANSVERSE_PAPER
= 52;
162 const PAPERSIZE_A4_TRANSVERSE_PAPER
= 53;
163 const PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER
= 54;
164 const PAPERSIZE_SUPERA_SUPERA_A4_PAPER
= 55;
165 const PAPERSIZE_SUPERB_SUPERB_A3_PAPER
= 56;
166 const PAPERSIZE_LETTER_PLUS_PAPER
= 57;
167 const PAPERSIZE_A4_PLUS_PAPER
= 58;
168 const PAPERSIZE_A5_TRANSVERSE_PAPER
= 59;
169 const PAPERSIZE_JIS_B5_TRANSVERSE_PAPER
= 60;
170 const PAPERSIZE_A3_EXTRA_PAPER
= 61;
171 const PAPERSIZE_A5_EXTRA_PAPER
= 62;
172 const PAPERSIZE_ISO_B5_EXTRA_PAPER
= 63;
173 const PAPERSIZE_A2_PAPER
= 64;
174 const PAPERSIZE_A3_TRANSVERSE_PAPER
= 65;
175 const PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER
= 66;
177 /* Page orientation */
178 const ORIENTATION_DEFAULT
= 'default';
179 const ORIENTATION_LANDSCAPE
= 'landscape';
180 const ORIENTATION_PORTRAIT
= 'portrait';
182 /* Print Range Set Method */
183 const SETPRINTRANGE_OVERWRITE
= 'O';
184 const SETPRINTRANGE_INSERT
= 'I';
192 private $_paperSize = PHPExcel_Worksheet_PageSetup
::PAPERSIZE_LETTER
;
199 private $_orientation = PHPExcel_Worksheet_PageSetup
::ORIENTATION_DEFAULT
;
202 * Scale (Print Scale)
204 * Print scaling. Valid values range from 10 to 400
205 * This setting is overridden when fitToWidth and/or fitToHeight are in use
209 private $_scale = 100;
213 * Whether scale or fitToWith / fitToHeight applies
217 private $_fitToPage = FALSE;
221 * Number of vertical pages to fit on
225 private $_fitToHeight = 1;
229 * Number of horizontal pages to fit on
233 private $_fitToWidth = 1;
236 * Columns to repeat at left
238 * @var array Containing start column and end column, empty array if option unset
240 private $_columnsToRepeatAtLeft = array('', '');
243 * Rows to repeat at top
245 * @var array Containing start row number and end row number, empty array if option unset
247 private $_rowsToRepeatAtTop = array(0, 0);
250 * Center page horizontally
254 private $_horizontalCentered = FALSE;
257 * Center page vertically
261 private $_verticalCentered = FALSE;
268 private $_printArea = NULL;
275 private $_firstPageNumber = NULL;
278 * Create a new PHPExcel_Worksheet_PageSetup
280 public function __construct()
289 public function getPaperSize() {
290 return $this->_paperSize
;
297 * @return PHPExcel_Worksheet_PageSetup
299 public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup
::PAPERSIZE_LETTER
) {
300 $this->_paperSize
= $pValue;
309 public function getOrientation() {
310 return $this->_orientation
;
316 * @param string $pValue
317 * @return PHPExcel_Worksheet_PageSetup
319 public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup
::ORIENTATION_DEFAULT
) {
320 $this->_orientation
= $pValue;
329 public function getScale() {
330 return $this->_scale
;
336 * Print scaling. Valid values range from 10 to 400
337 * This setting is overridden when fitToWidth and/or fitToHeight are in use
339 * @param int? $pValue
340 * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
341 * @return PHPExcel_Worksheet_PageSetup
342 * @throws PHPExcel_Exception
344 public function setScale($pValue = 100, $pUpdate = true) {
345 // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
346 // but it is apparently still able to handle any scale >= 0, where 0 results in 100
347 if (($pValue >= 0) ||
is_null($pValue)) {
348 $this->_scale
= $pValue;
350 $this->_fitToPage
= false;
353 throw new PHPExcel_Exception("Scale must not be negative");
363 public function getFitToPage() {
364 return $this->_fitToPage
;
370 * @param boolean $pValue
371 * @return PHPExcel_Worksheet_PageSetup
373 public function setFitToPage($pValue = TRUE) {
374 $this->_fitToPage
= $pValue;
383 public function getFitToHeight() {
384 return $this->_fitToHeight
;
390 * @param int? $pValue
391 * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
392 * @return PHPExcel_Worksheet_PageSetup
394 public function setFitToHeight($pValue = 1, $pUpdate = TRUE) {
395 $this->_fitToHeight
= $pValue;
397 $this->_fitToPage
= TRUE;
407 public function getFitToWidth() {
408 return $this->_fitToWidth
;
414 * @param int? $pValue
415 * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
416 * @return PHPExcel_Worksheet_PageSetup
418 public function setFitToWidth($pValue = 1, $pUpdate = TRUE) {
419 $this->_fitToWidth
= $pValue;
421 $this->_fitToPage
= TRUE;
427 * Is Columns to repeat at left set?
431 public function isColumnsToRepeatAtLeftSet() {
432 if (is_array($this->_columnsToRepeatAtLeft
)) {
433 if ($this->_columnsToRepeatAtLeft
[0] != '' && $this->_columnsToRepeatAtLeft
[1] != '') {
442 * Get Columns to repeat at left
444 * @return array Containing start column and end column, empty array if option unset
446 public function getColumnsToRepeatAtLeft() {
447 return $this->_columnsToRepeatAtLeft
;
451 * Set Columns to repeat at left
453 * @param array $pValue Containing start column and end column, empty array if option unset
454 * @return PHPExcel_Worksheet_PageSetup
456 public function setColumnsToRepeatAtLeft($pValue = null) {
457 if (is_array($pValue)) {
458 $this->_columnsToRepeatAtLeft
= $pValue;
464 * Set Columns to repeat at left by start and end
466 * @param string $pStart
467 * @param string $pEnd
468 * @return PHPExcel_Worksheet_PageSetup
470 public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A') {
471 $this->_columnsToRepeatAtLeft
= array($pStart, $pEnd);
476 * Is Rows to repeat at top set?
480 public function isRowsToRepeatAtTopSet() {
481 if (is_array($this->_rowsToRepeatAtTop
)) {
482 if ($this->_rowsToRepeatAtTop
[0] != 0 && $this->_rowsToRepeatAtTop
[1] != 0) {
491 * Get Rows to repeat at top
493 * @return array Containing start column and end column, empty array if option unset
495 public function getRowsToRepeatAtTop() {
496 return $this->_rowsToRepeatAtTop
;
500 * Set Rows to repeat at top
502 * @param array $pValue Containing start column and end column, empty array if option unset
503 * @return PHPExcel_Worksheet_PageSetup
505 public function setRowsToRepeatAtTop($pValue = null) {
506 if (is_array($pValue)) {
507 $this->_rowsToRepeatAtTop
= $pValue;
513 * Set Rows to repeat at top by start and end
517 * @return PHPExcel_Worksheet_PageSetup
519 public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1) {
520 $this->_rowsToRepeatAtTop
= array($pStart, $pEnd);
525 * Get center page horizontally
529 public function getHorizontalCentered() {
530 return $this->_horizontalCentered
;
534 * Set center page horizontally
537 * @return PHPExcel_Worksheet_PageSetup
539 public function setHorizontalCentered($value = false) {
540 $this->_horizontalCentered
= $value;
545 * Get center page vertically
549 public function getVerticalCentered() {
550 return $this->_verticalCentered
;
554 * Set center page vertically
557 * @return PHPExcel_Worksheet_PageSetup
559 public function setVerticalCentered($value = false) {
560 $this->_verticalCentered
= $value;
567 * @param int $index Identifier for a specific print area range if several ranges have been set
568 * Default behaviour, or a index value of 0, will return all ranges as a comma-separated string
569 * Otherwise, the specific range identified by the value of $index will be returned
570 * Print areas are numbered from 1
571 * @throws PHPExcel_Exception
574 public function getPrintArea($index = 0) {
576 return $this->_printArea
;
578 $printAreas = explode(',',$this->_printArea
);
579 if (isset($printAreas[$index-1])) {
580 return $printAreas[$index-1];
582 throw new PHPExcel_Exception("Requested Print Area does not exist");
588 * @param int $index Identifier for a specific print area range if several ranges have been set
589 * Default behaviour, or an index value of 0, will identify whether any print range is set
590 * Otherwise, existence of the range identified by the value of $index will be returned
591 * Print areas are numbered from 1
594 public function isPrintAreaSet($index = 0) {
596 return !is_null($this->_printArea
);
598 $printAreas = explode(',',$this->_printArea
);
599 return isset($printAreas[$index-1]);
605 * @param int $index Identifier for a specific print area range if several ranges have been set
606 * Default behaviour, or an index value of 0, will clear all print ranges that are set
607 * Otherwise, the range identified by the value of $index will be removed from the series
608 * Print areas are numbered from 1
609 * @return PHPExcel_Worksheet_PageSetup
611 public function clearPrintArea($index = 0) {
613 $this->_printArea
= NULL;
615 $printAreas = explode(',',$this->_printArea
);
616 if (isset($printAreas[$index-1])) {
617 unset($printAreas[$index-1]);
618 $this->_printArea
= implode(',',$printAreas);
626 * Set print area. e.g. 'A1:D10' or 'A1:D10,G5:M20'
628 * @param string $value
629 * @param int $index Identifier for a specific print area range allowing several ranges to be set
630 * When the method is "O"verwrite, then a positive integer index will overwrite that indexed
631 * entry in the print areas list; a negative index value will identify which entry to
632 * overwrite working bacward through the print area to the list, with the last entry as -1.
633 * Specifying an index value of 0, will overwrite <b>all</b> existing print ranges.
634 * When the method is "I"nsert, then a positive index will insert after that indexed entry in
635 * the print areas list, while a negative index will insert before the indexed entry.
636 * Specifying an index value of 0, will always append the new print range at the end of the
638 * Print areas are numbered from 1
639 * @param string $method Determines the method used when setting multiple print areas
640 * Default behaviour, or the "O" method, overwrites existing print area
641 * The "I" method, inserts the new print area before any specified index, or at the end of the list
642 * @return PHPExcel_Worksheet_PageSetup
643 * @throws PHPExcel_Exception
645 public function setPrintArea($value, $index = 0, $method = self
::SETPRINTRANGE_OVERWRITE
) {
646 if (strpos($value,'!') !== false) {
647 throw new PHPExcel_Exception('Cell coordinate must not specify a worksheet.');
648 } elseif (strpos($value,':') === false) {
649 throw new PHPExcel_Exception('Cell coordinate must be a range of cells.');
650 } elseif (strpos($value,'$') !== false) {
651 throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
653 $value = strtoupper($value);
655 if ($method == self
::SETPRINTRANGE_OVERWRITE
) {
657 $this->_printArea
= $value;
659 $printAreas = explode(',',$this->_printArea
);
661 $index = count($printAreas) - abs($index) +
1;
663 if (($index <= 0) ||
($index > count($printAreas))) {
664 throw new PHPExcel_Exception('Invalid index for setting print range.');
666 $printAreas[$index-1] = $value;
667 $this->_printArea
= implode(',',$printAreas);
669 } elseif($method == self
::SETPRINTRANGE_INSERT
) {
671 $this->_printArea
.= ($this->_printArea
== '') ?
$value : ','.$value;
673 $printAreas = explode(',',$this->_printArea
);
675 $index = abs($index) - 1;
677 if ($index > count($printAreas)) {
678 throw new PHPExcel_Exception('Invalid index for setting print range.');
680 $printAreas = array_merge(array_slice($printAreas,0,$index),array($value),array_slice($printAreas,$index));
681 $this->_printArea
= implode(',',$printAreas);
684 throw new PHPExcel_Exception('Invalid method for setting print range.');
691 * Add a new print area (e.g. 'A1:D10' or 'A1:D10,G5:M20') to the list of print areas
693 * @param string $value
694 * @param int $index Identifier for a specific print area range allowing several ranges to be set
695 * A positive index will insert after that indexed entry in the print areas list, while a
696 * negative index will insert before the indexed entry.
697 * Specifying an index value of 0, will always append the new print range at the end of the
699 * Print areas are numbered from 1
700 * @return PHPExcel_Worksheet_PageSetup
701 * @throws PHPExcel_Exception
703 public function addPrintArea($value, $index = -1) {
704 return $this->setPrintArea($value, $index, self
::SETPRINTRANGE_INSERT
);
710 * @param int $column1 Column 1
711 * @param int $row1 Row 1
712 * @param int $column2 Column 2
713 * @param int $row2 Row 2
714 * @param int $index Identifier for a specific print area range allowing several ranges to be set
715 * When the method is "O"verwrite, then a positive integer index will overwrite that indexed
716 * entry in the print areas list; a negative index value will identify which entry to
717 * overwrite working bacward through the print area to the list, with the last entry as -1.
718 * Specifying an index value of 0, will overwrite <b>all</b> existing print ranges.
719 * When the method is "I"nsert, then a positive index will insert after that indexed entry in
720 * the print areas list, while a negative index will insert before the indexed entry.
721 * Specifying an index value of 0, will always append the new print range at the end of the
723 * Print areas are numbered from 1
724 * @param string $method Determines the method used when setting multiple print areas
725 * Default behaviour, or the "O" method, overwrites existing print area
726 * The "I" method, inserts the new print area before any specified index, or at the end of the list
727 * @return PHPExcel_Worksheet_PageSetup
728 * @throws PHPExcel_Exception
730 public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self
::SETPRINTRANGE_OVERWRITE
)
732 return $this->setPrintArea(PHPExcel_Cell
::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell
::stringFromColumnIndex($column2) . $row2, $index, $method);
736 * Add a new print area to the list of print areas
738 * @param int $column1 Start Column for the print area
739 * @param int $row1 Start Row for the print area
740 * @param int $column2 End Column for the print area
741 * @param int $row2 End Row for the print area
742 * @param int $index Identifier for a specific print area range allowing several ranges to be set
743 * A positive index will insert after that indexed entry in the print areas list, while a
744 * negative index will insert before the indexed entry.
745 * Specifying an index value of 0, will always append the new print range at the end of the
747 * Print areas are numbered from 1
748 * @return PHPExcel_Worksheet_PageSetup
749 * @throws PHPExcel_Exception
751 public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
753 return $this->setPrintArea(PHPExcel_Cell
::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell
::stringFromColumnIndex($column2) . $row2, $index, self
::SETPRINTRANGE_INSERT
);
757 * Get first page number
761 public function getFirstPageNumber() {
762 return $this->_firstPageNumber
;
766 * Set first page number
769 * @return PHPExcel_Worksheet_HeaderFooter
771 public function setFirstPageNumber($value = null) {
772 $this->_firstPageNumber
= $value;
777 * Reset first page number
779 * @return PHPExcel_Worksheet_HeaderFooter
781 public function resetFirstPageNumber() {
782 return $this->setFirstPageNumber(null);
786 * Implement PHP __clone to create a deep clone, not just a shallow copy.
788 public function __clone() {
789 $vars = get_object_vars($this);
790 foreach ($vars as $key => $value) {
791 if (is_object($value)) {
792 $this->$key = clone $value;
794 $this->$key = $value;