PHPExcel_Worksheet
[ class tree: PHPExcel_Worksheet ] [ index: PHPExcel_Worksheet ] [ all elements ]

Source for file PageSetup.php

Documentation is available at PageSetup.php

  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * Copyright (c) 2006 - 2010 PHPExcel
  6.  *
  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.
  11.  *
  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.
  16.  *
  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
  20.  *
  21.  * @category   PHPExcel
  22.  * @package    PHPExcel_Worksheet
  23.  * @copyright  Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.7.3c, 2010-06-01
  26.  */
  27.  
  28.  
  29. /**
  30.  * PHPExcel_Worksheet_PageSetup
  31.  *
  32.  * <code>
  33.  * Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988:
  34.  *
  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)
  101.  * </code>
  102.  *
  103.  * @category   PHPExcel
  104.  * @package    PHPExcel_Worksheet
  105.  * @copyright  Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
  106.  */
  107. {
  108.     /* Paper size */
  109.     const PAPERSIZE_LETTER                            1;
  110.     const PAPERSIZE_LETTER_SMALL                    2;
  111.     const PAPERSIZE_TABLOID                            3;
  112.     const PAPERSIZE_LEDGER                            4;
  113.     const PAPERSIZE_LEGAL                            5;
  114.     const PAPERSIZE_STATEMENT                        6;
  115.     const PAPERSIZE_EXECUTIVE                        7;
  116.     const PAPERSIZE_A3                                8;
  117.     const PAPERSIZE_A4                                9;
  118.     const PAPERSIZE_A4_SMALL                        10;
  119.     const PAPERSIZE_A5                                11;
  120.     const PAPERSIZE_B4                                12;
  121.     const PAPERSIZE_B5                                13;
  122.     const PAPERSIZE_FOLIO                            14;
  123.     const PAPERSIZE_QUARTO                            15;
  124.     const PAPERSIZE_STANDARD_1                        16;
  125.     const PAPERSIZE_STANDARD_2                        17;
  126.     const PAPERSIZE_NOTE                            18;
  127.     const PAPERSIZE_NO9_ENVELOPE                    19;
  128.     const PAPERSIZE_NO10_ENVELOPE                    20;
  129.     const PAPERSIZE_NO11_ENVELOPE                    21;
  130.     const PAPERSIZE_NO12_ENVELOPE                    22;
  131.     const PAPERSIZE_NO14_ENVELOPE                    23;
  132.     const PAPERSIZE_C                                24;
  133.     const PAPERSIZE_D                                25;
  134.     const PAPERSIZE_E                                26;
  135.     const PAPERSIZE_DL_ENVELOPE                        27;
  136.     const PAPERSIZE_C5_ENVELOPE                        28;
  137.     const PAPERSIZE_C3_ENVELOPE                        29;
  138.     const PAPERSIZE_C4_ENVELOPE                        30;
  139.     const PAPERSIZE_C6_ENVELOPE                        31;
  140.     const PAPERSIZE_C65_ENVELOPE                    32;
  141.     const PAPERSIZE_B4_ENVELOPE                        33;
  142.     const PAPERSIZE_B5_ENVELOPE                        34;
  143.     const PAPERSIZE_B6_ENVELOPE                        35;
  144.     const PAPERSIZE_ITALY_ENVELOPE                    36;
  145.     const PAPERSIZE_MONARCH_ENVELOPE                37;
  146.     const PAPERSIZE_6_3_4_ENVELOPE                    38;
  147.     const PAPERSIZE_US_STANDARD_FANFOLD                39;
  148.     const PAPERSIZE_GERMAN_STANDARD_FANFOLD            40;
  149.     const PAPERSIZE_GERMAN_LEGAL_FANFOLD            41;
  150.     const PAPERSIZE_ISO_B4                            42;
  151.     const PAPERSIZE_JAPANESE_DOUBLE_POSTCARD        43;
  152.     const PAPERSIZE_STANDARD_PAPER_1                44;
  153.     const PAPERSIZE_STANDARD_PAPER_2                45;
  154.     const PAPERSIZE_STANDARD_PAPER_3                46;
  155.     const PAPERSIZE_INVITE_ENVELOPE                    47;
  156.     const PAPERSIZE_LETTER_EXTRA_PAPER                48;
  157.     const PAPERSIZE_LEGAL_EXTRA_PAPER                49;
  158.     const PAPERSIZE_TABLOID_EXTRA_PAPER                50;
  159.     const PAPERSIZE_A4_EXTRA_PAPER                    51;
  160.     const PAPERSIZE_LETTER_TRANSVERSE_PAPER            52;
  161.     const PAPERSIZE_A4_TRANSVERSE_PAPER                53;
  162.     const PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER    54;
  163.     const PAPERSIZE_SUPERA_SUPERA_A4_PAPER            55;
  164.     const PAPERSIZE_SUPERB_SUPERB_A3_PAPER            56;
  165.     const PAPERSIZE_LETTER_PLUS_PAPER                57;
  166.     const PAPERSIZE_A4_PLUS_PAPER                    58;
  167.     const PAPERSIZE_A5_TRANSVERSE_PAPER                59;
  168.     const PAPERSIZE_JIS_B5_TRANSVERSE_PAPER            60;
  169.     const PAPERSIZE_A3_EXTRA_PAPER                    61;
  170.     const PAPERSIZE_A5_EXTRA_PAPER                    62;
  171.     const PAPERSIZE_ISO_B5_EXTRA_PAPER                63;
  172.     const PAPERSIZE_A2_PAPER                        64;
  173.     const PAPERSIZE_A3_TRANSVERSE_PAPER                65;
  174.     const PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER        66;
  175.  
  176.     /* Page orientation */
  177.     const ORIENTATION_DEFAULT    'default';
  178.     const ORIENTATION_LANDSCAPE    'landscape';
  179.     const ORIENTATION_PORTRAIT    'portrait';
  180.  
  181.     /**
  182.      * Paper size
  183.      *
  184.      * @var int 
  185.      */
  186.     private $_paperSize;
  187.  
  188.     /**
  189.      * Orientation
  190.      *
  191.      * @var string 
  192.      */
  193.     private $_orientation;
  194.  
  195.     /**
  196.      * Scale (Print Scale)
  197.      *
  198.      * Print scaling. Valid values range from 10 to 400
  199.      * This setting is overridden when fitToWidth and/or fitToHeight are in use
  200.      *
  201.      * @var int? 
  202.      */
  203.     private $_scale;
  204.  
  205.     /**
  206.       * Fit To Page
  207.       * Whether scale or fitToWith / fitToHeight applies
  208.       *
  209.       * @var boolean 
  210.       */
  211.     private $_fitToPage;
  212.  
  213.     /**
  214.       * Fit To Height
  215.       * Number of vertical pages to fit on
  216.       *
  217.       * @var int? 
  218.       */
  219.     private $_fitToHeight;
  220.  
  221.     /**
  222.       * Fit To Width
  223.       * Number of horizontal pages to fit on
  224.       *
  225.       * @var int? 
  226.       */
  227.     private $_fitToWidth;
  228.  
  229.     /**
  230.      * Columns to repeat at left
  231.      *
  232.      * @var array Containing start column and end column, empty array if option unset
  233.      */
  234.     private $_columnsToRepeatAtLeft array('''');
  235.  
  236.     /**
  237.      * Rows to repeat at top
  238.      *
  239.      * @var array Containing start row number and end row number, empty array if option unset
  240.      */
  241.     private $_rowsToRepeatAtTop array(00);
  242.  
  243.     /**
  244.      * Center page horizontally
  245.      *
  246.      * @var boolean 
  247.      */
  248.     private $_horizontalCentered false;
  249.  
  250.     /**
  251.      * Center page vertically
  252.      *
  253.      * @var boolean 
  254.      */
  255.     private $_verticalCentered false;
  256.  
  257.     /**
  258.      * Print area
  259.      *
  260.      * @var string 
  261.      */
  262.     private $_printArea null;
  263.     
  264.     /**
  265.      * First page number
  266.      *
  267.      * @var int 
  268.      */
  269.     private $_firstPageNumber null;
  270.  
  271.     /**
  272.      * Create a new PHPExcel_Worksheet_PageSetup
  273.      */
  274.     public function __construct()
  275.     {
  276.         // Initialise values
  277.         $this->_paperSize                 PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER;
  278.         $this->_orientation                PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT;
  279.         $this->_scale                    100;
  280.         $this->_fitToPage                false;
  281.         $this->_fitToHeight                1;
  282.         $this->_fitToWidth                1;
  283.         $this->_columnsToRepeatAtLeft     array('''');
  284.         $this->_rowsToRepeatAtTop        array(00);
  285.         $this->_horizontalCentered        false;
  286.         $this->_verticalCentered        false;
  287.         $this->_printArea                null;
  288.         $this->_firstPageNumber         null;
  289.     }
  290.  
  291.     /**
  292.      * Get Paper Size
  293.      *
  294.      * @return int 
  295.      */
  296.     public function getPaperSize({
  297.         return $this->_paperSize;
  298.     }
  299.  
  300.     /**
  301.      * Set Paper Size
  302.      *
  303.      * @param int $pValue 
  304.      * @return PHPExcel_Worksheet_PageSetup 
  305.      */
  306.     public function setPaperSize($pValue PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER{
  307.         $this->_paperSize $pValue;
  308.         return $this;
  309.     }
  310.  
  311.     /**
  312.      * Get Orientation
  313.      *
  314.      * @return string 
  315.      */
  316.     public function getOrientation({
  317.         return $this->_orientation;
  318.     }
  319.  
  320.     /**
  321.      * Set Orientation
  322.      *
  323.      * @param string $pValue 
  324.      * @return PHPExcel_Worksheet_PageSetup 
  325.      */
  326.     public function setOrientation($pValue PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT{
  327.         $this->_orientation $pValue;
  328.         return $this;
  329.     }
  330.  
  331.     /**
  332.      * Get Scale
  333.      *
  334.      * @return int? 
  335.      */
  336.     public function getScale({
  337.         return $this->_scale;
  338.     }
  339.  
  340.     /**
  341.      * Set Scale
  342.      *
  343.      * Print scaling. Valid values range from 10 to 400
  344.      * This setting is overridden when fitToWidth and/or fitToHeight are in use
  345.      *
  346.      * @param     int?     $pValue 
  347.      * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
  348.      * @throws     Exception
  349.      * @return PHPExcel_Worksheet_PageSetup 
  350.      */
  351.     public function setScale($pValue 100$pUpdate true{
  352.         // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
  353.         // but it is apparently still able to handle any scale >= 0, where 0 results in 100
  354.         if (($pValue >= 0|| is_null($pValue)) {
  355.             $this->_scale $pValue;
  356.             if ($pUpdate{
  357.                 $this->_fitToPage false;
  358.             }
  359.         else {
  360.             throw new Exception("Scale must not be negative");
  361.         }
  362.         return $this;
  363.     }
  364.  
  365.     /**
  366.      * Get Fit To Page
  367.      *
  368.      * @return boolean 
  369.      */
  370.     public function getFitToPage({
  371.         return $this->_fitToPage;
  372.     }
  373.  
  374.     /**
  375.      * Set Fit To Page
  376.      *
  377.      * @param boolean $pValue 
  378.      * @return PHPExcel_Worksheet_PageSetup 
  379.      */
  380.     public function setFitToPage($pValue true{
  381.         $this->_fitToPage $pValue;
  382.         return $this;
  383.     }
  384.  
  385.     /**
  386.      * Get Fit To Height
  387.      *
  388.      * @return int? 
  389.      */
  390.     public function getFitToHeight({
  391.         return $this->_fitToHeight;
  392.     }
  393.  
  394.     /**
  395.      * Set Fit To Height
  396.      *
  397.      * @param int? $pValue 
  398.      * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
  399.      * @return PHPExcel_Worksheet_PageSetup 
  400.      */
  401.     public function setFitToHeight($pValue 1$pUpdate true{
  402.         $this->_fitToHeight $pValue;
  403.         if ($pUpdate{
  404.             $this->_fitToPage true;
  405.         }
  406.         return $this;
  407.     }
  408.  
  409.     /**
  410.      * Get Fit To Width
  411.      *
  412.      * @return int? 
  413.      */
  414.     public function getFitToWidth({
  415.         return $this->_fitToWidth;
  416.     }
  417.  
  418.     /**
  419.      * Set Fit To Width
  420.      *
  421.      * @param int? $pValue 
  422.      * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
  423.      * @return PHPExcel_Worksheet_PageSetup 
  424.      */
  425.     public function setFitToWidth($pValue 1$pUpdate true{
  426.         $this->_fitToWidth $pValue;
  427.         if ($pUpdate{
  428.             $this->_fitToPage true;
  429.         }
  430.         return $this;
  431.     }
  432.  
  433.     /**
  434.      * Is Columns to repeat at left set?
  435.      *
  436.      * @return boolean 
  437.      */
  438.     public function isColumnsToRepeatAtLeftSet({
  439.         if (is_array($this->_columnsToRepeatAtLeft)) {
  440.             if ($this->_columnsToRepeatAtLeft[0!= '' && $this->_columnsToRepeatAtLeft[1!= ''{
  441.                 return true;
  442.             }
  443.         }
  444.  
  445.         return false;
  446.     }
  447.  
  448.     /**
  449.      * Get Columns to repeat at left
  450.      *
  451.      * @return array Containing start column and end column, empty array if option unset
  452.      */
  453.     public function getColumnsToRepeatAtLeft({
  454.         return $this->_columnsToRepeatAtLeft;
  455.     }
  456.  
  457.     /**
  458.      * Set Columns to repeat at left
  459.      *
  460.      * @param array $pValue Containing start column and end column, empty array if option unset
  461.      * @return PHPExcel_Worksheet_PageSetup 
  462.      */
  463.     public function setColumnsToRepeatAtLeft($pValue null{
  464.         if (is_array($pValue)) {
  465.             $this->_columnsToRepeatAtLeft $pValue;
  466.         }
  467.         return $this;
  468.     }
  469.  
  470.     /**
  471.      * Set Columns to repeat at left by start and end
  472.      *
  473.      * @param string $pStart 
  474.      * @param string $pEnd 
  475.      * @return PHPExcel_Worksheet_PageSetup 
  476.      */
  477.     public function setColumnsToRepeatAtLeftByStartAndEnd($pStart 'A'$pEnd 'A'{
  478.         $this->_columnsToRepeatAtLeft array($pStart$pEnd);
  479.         return $this;
  480.     }
  481.  
  482.     /**
  483.      * Is Rows to repeat at top set?
  484.      *
  485.      * @return boolean 
  486.      */
  487.     public function isRowsToRepeatAtTopSet({
  488.         if (is_array($this->_rowsToRepeatAtTop)) {
  489.             if ($this->_rowsToRepeatAtTop[0!= && $this->_rowsToRepeatAtTop[1!= 0{
  490.                 return true;
  491.             }
  492.         }
  493.  
  494.         return false;
  495.     }
  496.  
  497.     /**
  498.      * Get Rows to repeat at top
  499.      *
  500.      * @return array Containing start column and end column, empty array if option unset
  501.      */
  502.     public function getRowsToRepeatAtTop({
  503.         return $this->_rowsToRepeatAtTop;
  504.     }
  505.  
  506.     /**
  507.      * Set Rows to repeat at top
  508.      *
  509.      * @param array $pValue Containing start column and end column, empty array if option unset
  510.      * @return PHPExcel_Worksheet_PageSetup 
  511.      */
  512.     public function setRowsToRepeatAtTop($pValue null{
  513.         if (is_array($pValue)) {
  514.             $this->_rowsToRepeatAtTop $pValue;
  515.         }
  516.         return $this;
  517.     }
  518.  
  519.     /**
  520.      * Set Rows to repeat at top by start and end
  521.      *
  522.      * @param int $pStart 
  523.      * @param int $pEnd 
  524.      * @return PHPExcel_Worksheet_PageSetup 
  525.      */
  526.     public function setRowsToRepeatAtTopByStartAndEnd($pStart 1$pEnd 1{
  527.         $this->_rowsToRepeatAtTop array($pStart$pEnd);
  528.         return $this;
  529.     }
  530.  
  531.     /**
  532.      * Get center page horizontally
  533.      *
  534.      * @return bool 
  535.      */
  536.     public function getHorizontalCentered({
  537.         return $this->_horizontalCentered;
  538.     }
  539.  
  540.     /**
  541.      * Set center page horizontally
  542.      *
  543.      * @param bool $value 
  544.      * @return PHPExcel_Worksheet_PageSetup 
  545.      */
  546.     public function setHorizontalCentered($value false{
  547.         $this->_horizontalCentered $value;
  548.         return $this;
  549.     }
  550.  
  551.     /**
  552.      * Get center page vertically
  553.      *
  554.      * @return bool 
  555.      */
  556.     public function getVerticalCentered({
  557.         return $this->_verticalCentered;
  558.     }
  559.  
  560.     /**
  561.      * Set center page vertically
  562.      *
  563.      * @param bool $value 
  564.      * @return PHPExcel_Worksheet_PageSetup 
  565.      */
  566.     public function setVerticalCentered($value false{
  567.         $this->_verticalCentered $value;
  568.         return $this;
  569.     }
  570.  
  571.     /**
  572.      * Get print area
  573.      *
  574.      * @return string 
  575.      */
  576.     public function getPrintArea({
  577.         return $this->_printArea;
  578.     }
  579.  
  580.     /**
  581.      * Is print area set?
  582.      *
  583.      * @return boolean 
  584.      */
  585.     public function isPrintAreaSet({
  586.         return !is_null($this->_printArea);
  587.     }
  588.  
  589.     /**
  590.      * Set print area. E.g. 'A1:D10' or 'A1:D10,G5:M20'
  591.      *
  592.      * @param string $value 
  593.      * @throws Exception
  594.      * @return PHPExcel_Worksheet_PageSetup 
  595.      */
  596.     public function setPrintArea($value{
  597.         if (strpos($value,':'=== false{
  598.             throw new Exception('Cell coordinate must be a range of cells.');
  599.         elseif (strpos($value,'$'!== false{
  600.             throw new Exception('Cell coordinate must not be absolute.');
  601.         else {
  602.             $this->_printArea strtoupper($value);
  603.         }
  604.         return $this;
  605.     }
  606.  
  607.     /**
  608.      * Set print area
  609.      *
  610.      * @param int $column1        Column 1
  611.      * @param int $row1            Row 1
  612.      * @param int $column2        Column 2
  613.      * @param int $row2            Row 2
  614.      * @return PHPExcel_Worksheet_PageSetup 
  615.      */
  616.     public function setPrintAreaByColumnAndRow($column1$row1$column2$row2)
  617.     {
  618.         return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1$row1 ':' PHPExcel_Cell::stringFromColumnIndex($column2$row2);
  619.     }
  620.     
  621.     /**
  622.      * Get first page number
  623.      *
  624.      * @return int 
  625.      */
  626.     public function getFirstPageNumber({
  627.         return $this->_firstPageNumber;
  628.     }
  629.     
  630.     /**
  631.      * Set first page number
  632.      *
  633.      * @param int $value 
  634.      * @return PHPExcel_Worksheet_HeaderFooter 
  635.      */
  636.     public function setFirstPageNumber($value null{
  637.         $this->_firstPageNumber $value;
  638.         return $this;
  639.     }
  640.     
  641.     /**
  642.      * Reset first page number
  643.      *
  644.      * @return PHPExcel_Worksheet_HeaderFooter 
  645.      */
  646.     public function resetFirstPageNumber({
  647.         return $this->setFirstPageNumber(null);
  648.     }
  649.  
  650.     /**
  651.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  652.      */
  653.     public function __clone({
  654.         $vars get_object_vars($this);
  655.         foreach ($vars as $key => $value{
  656.             if (is_object($value)) {
  657.                 $this->$key clone $value;
  658.             else {
  659.                 $this->$key $value;
  660.             }
  661.         }
  662.     }
  663. }

Documentation generated on Tue, 01 Jun 2010 17:05:29 +0200 by phpDocumentor 1.4.3