107                $this->_phpExcel        = $phpExcel;
 
  118        public function save($pFilename = 
null) {
 
  121                $this->_phpExcel->garbageCollect();
 
  129                $this->_colors          = array();
 
  133                                                                                                                                         $this->_str_total, $this->_str_unique, $this->_str_table,
 
  134                                                                                                                                         $this->_colors, $this->_parser);
 
  137                $countSheets = $this->_phpExcel->getSheetCount();
 
  138                for (
$i = 0; 
$i < $countSheets; ++
$i) {
 
  140                                                                                                                                                           $this->_str_table, $this->_colors,
 
  142                                                                                                                                                           $this->_preCalculateFormulas,
 
  143                                                                                                                                                           $this->_phpExcel->getSheet(
$i));
 
  152                $cellXfCollection = $this->_phpExcel->getCellXfCollection();
 
  153                for (
$i = 0; 
$i < 15; ++
$i) {
 
  154                        $this->_writerWorkbook->addXfWriter($cellXfCollection[0], 
true);
 
  158                foreach ($this->_phpExcel->getCellXfCollection() as 
$style) {
 
  159                        $this->_writerWorkbook->addXfWriter(
$style, 
false);
 
  163                for (
$i = 0; 
$i < $countSheets; ++
$i) {
 
  164                        foreach ($this->_writerWorksheets[
$i]->_phpSheet->getCellCollection() as $cellID) {
 
  165                                $cell = $this->_writerWorksheets[
$i]->_phpSheet->getCell($cellID);
 
  166                                $cVal = $cell->getValue();
 
  168                                        $elements = $cVal->getRichTextElements();
 
  169                                        foreach ($elements as $element) {
 
  171                                                        $font = $element->getFont();
 
  172                                                        $this->_writerWorksheets[
$i]->_fntHashIndex[$font->getHashCode()] = $this->_writerWorkbook->_addFont($font);
 
  180                $workbookStreamName = 
'Workbook';
 
  185                $worksheetSizes = array();
 
  186                for (
$i = 0; 
$i < $countSheets; ++
$i) {
 
  187                        $this->_writerWorksheets[
$i]->close();
 
  188                        $worksheetSizes[] = $this->_writerWorksheets[
$i]->_datasize;
 
  192                $OLE->append($this->_writerWorkbook->writeWorkbook($worksheetSizes));
 
  195                for (
$i = 0; 
$i < $countSheets; ++
$i) {
 
  196                        $OLE->append($this->_writerWorksheets[
$i]->getData());
 
  201                if(isset($this->_documentSummaryInformation) && !empty($this->_documentSummaryInformation)){
 
  203                        $OLE_DocumentSummaryInformation->append($this->_documentSummaryInformation);
 
  208                if(isset($this->_summaryInformation) && !empty($this->_summaryInformation)){
 
  210                  $OLE_SummaryInformation->append($this->_summaryInformation);
 
  214                $arrRootData = array($OLE);
 
  216                if(isset($OLE_SummaryInformation)){
 
  217                        $arrRootData[] = $OLE_SummaryInformation;
 
  220                if(isset($OLE_DocumentSummaryInformation)){
 
  221                        $arrRootData[] = $OLE_DocumentSummaryInformation;
 
  226                $res = $root->save($pFilename);
 
  252                $lastReducedSpId = 0;
 
  255                foreach ($this->_phpExcel->getAllsheets() as $sheet) {
 
  257                        $sheetIndex = $sheet->getParent()->getIndex($sheet);
 
  262                        $filterRange = $sheet->getAutoFilter()->getRange();
 
  263                        if (count($sheet->getDrawingCollection()) == 0 && empty($filterRange)) {
 
  274                        $dgId = $sheet->getParent()->getIndex($sheet) + 1;
 
  275                        $dgContainer->setDgId($dgId);
 
  276                        $escher->setDgContainer($dgContainer);
 
  280                        $dgContainer->setSpgrContainer($spgrContainer);
 
  284                        $spContainer->setSpgr(
true);
 
  285                        $spContainer->setSpType(0);
 
  286                        $spContainer->setSpId(($sheet->getParent()->getIndex($sheet) + 1) << 10);
 
  287                        $spgrContainer->addChild($spContainer);
 
  291                        $countShapes[$sheetIndex] = 0; 
 
  293                        foreach ($sheet->getDrawingCollection() as $drawing) {
 
  296                                ++$countShapes[$sheetIndex];
 
  302                                $spContainer->setSpType(0x004B);
 
  304                                $spContainer->setSpFlag(0x02);
 
  307                                $reducedSpId = $countShapes[$sheetIndex];
 
  309                                        | ($sheet->getParent()->getIndex($sheet) + 1) << 10;
 
  310                                $spContainer->setSpId($spId);
 
  313                                $lastReducedSpId = $reducedSpId;
 
  319                                $spContainer->setOPT(0x4104, $blipIndex);
 
  322                                $coordinates = $drawing->getCoordinates();
 
  323                                $offsetX = $drawing->getOffsetX();
 
  324                                $offsetY = $drawing->getOffsetY();
 
  325                                $width = $drawing->getWidth();
 
  326                                $height = $drawing->getHeight();
 
  330                                $spContainer->setStartCoordinates($twoAnchor[
'startCoordinates']);
 
  331                                $spContainer->setStartOffsetX($twoAnchor[
'startOffsetX']);
 
  332                                $spContainer->setStartOffsetY($twoAnchor[
'startOffsetY']);
 
  333                                $spContainer->setEndCoordinates($twoAnchor[
'endCoordinates']);
 
  334                                $spContainer->setEndOffsetX($twoAnchor[
'endOffsetX']);
 
  335                                $spContainer->setEndOffsetY($twoAnchor[
'endOffsetY']);
 
  337                                $spgrContainer->addChild($spContainer);
 
  341                        if(!empty($filterRange)){
 
  343                                $iNumColStart = $rangeBounds[0][0];
 
  344                                $iNumColEnd = $rangeBounds[1][0];
 
  346                                $iInc = $iNumColStart;
 
  347                                while($iInc <= $iNumColEnd){
 
  348                                        ++$countShapes[$sheetIndex];
 
  354                                        $oDrawing->setCoordinates($cDrawing);
 
  355                                        $oDrawing->setWorksheet($sheet);
 
  360                                        $spContainer->setSpType(0x00C9);
 
  362                                        $spContainer->setSpFlag(0x01);
 
  365                                        $reducedSpId = $countShapes[$sheetIndex];
 
  367                                                | ($sheet->getParent()->getIndex($sheet) + 1) << 10;
 
  368                                        $spContainer->setSpId($spId);
 
  371                                        $lastReducedSpId = $reducedSpId;
 
  376                                        $spContainer->setOPT(0x007F, 0x01040104); 
 
  377                                        $spContainer->setOPT(0x00BF, 0x00080008); 
 
  378                                        $spContainer->setOPT(0x01BF, 0x00010000); 
 
  379                                        $spContainer->setOPT(0x01FF, 0x00080000); 
 
  380                                        $spContainer->setOPT(0x03BF, 0x000A0000); 
 
  384                                        $endCoordinates .= $rangeBounds[0][1] + 1;
 
  386                                        $spContainer->setStartCoordinates($cDrawing);
 
  387                                        $spContainer->setStartOffsetX(0);
 
  388                                        $spContainer->setStartOffsetY(0);
 
  389                                        $spContainer->setEndCoordinates($endCoordinates);
 
  390                                        $spContainer->setEndOffsetX(0);
 
  391                                        $spContainer->setEndOffsetY(0);
 
  393                                        $spgrContainer->addChild($spContainer);
 
  399                        $this->_IDCLs[$dgId] = $lastReducedSpId;
 
  402                        $dgContainer->setLastSpId($lastSpId);
 
  405                        $this->_writerWorksheets[$sheetIndex]->setEscher($escher);
 
  418                foreach ($this->_phpExcel->getAllSheets() as $sheet) {
 
  419                        if (count($sheet->getDrawingCollection()) > 0) {
 
  435                $escher->setDggContainer($dggContainer);
 
  438                $dggContainer->setIDCLs($this->_IDCLs);
 
  442                $totalCountShapes = 0;
 
  445                foreach ($this->_phpExcel->getAllsheets() as $sheet) {
 
  446                        $sheetCountShapes = 0; 
 
  448                        if (count($sheet->getDrawingCollection()) > 0) {
 
  451                                foreach ($sheet->getDrawingCollection() as $drawing) {
 
  455                                        $spId = $sheetCountShapes
 
  456                                                | ($this->_phpExcel->getIndex($sheet) + 1) << 10;
 
  457                                        $spIdMax = max($spId, $spIdMax);
 
  462                $dggContainer->setSpIdMax($spIdMax + 1);
 
  463                $dggContainer->setCDgSaved($countDrawings);
 
  464                $dggContainer->setCSpSaved($totalCountShapes + $countDrawings); 
 
  468                $dggContainer->setBstoreContainer($bstoreContainer);
 
  471                foreach ($this->_phpExcel->getAllsheets() as $sheet) {
 
  472                        foreach ($sheet->getDrawingCollection() as $drawing) {
 
  477                                        list($imagesx, $imagesy, $imageFormat) = getimagesize(
$filename);
 
  479                                        switch ($imageFormat) {
 
  485                                                $blipData = ob_get_contents();
 
  491                                                $blipData = file_get_contents(
$filename);
 
  496                                                $blipData = file_get_contents(
$filename);
 
  503                                                $blipData = ob_get_contents();
 
  512                                        $blip->setData($blipData);
 
  515                                        $BSE->setBlipType($blipType);
 
  516                                        $BSE->setBlip($blip);
 
  518                                        $bstoreContainer->addBSE($BSE);
 
  522                                        switch ($drawing->getRenderingFunction()) {
 
  526                                                $renderingFunction = 
'imagejpeg';
 
  533                                                $renderingFunction = 
'imagepng';
 
  539                                        call_user_func($renderingFunction, $drawing->getImageResource());
 
  540                                        $blipData = ob_get_contents();
 
  544                                        $blip->setData($blipData);
 
  547                                        $BSE->setBlipType($blipType);
 
  548                                        $BSE->setBlip($blip);
 
  550                                        $bstoreContainer->addBSE($BSE);
 
  556                $this->_writerWorkbook->setEscher($escher);
 
  566                $data = pack(
'v', 0xFFFE);
 
  568                $data .= pack(
'v', 0x0000);
 
  570                $data .= pack(
'v', 0x0106);
 
  572                $data .= pack(
'v', 0x0002);
 
  574                $data .= pack(
'VVVV', 0x00, 0x00, 0x00, 0x00);
 
  576                $data .= pack(
'V', 0x0001);
 
  579                $data .= pack(
'vvvvvvvv', 0xD502, 0xD5CD, 0x2E9C, 0x101B, 0x9793, 0x0008, 0x2C2B, 0xAEF9);
 
  581                $data .= pack(
'V', 0x30);
 
  584                $dataSection = array();
 
  585                $dataSection_NumProps = 0;
 
  586                $dataSection_Summary = 
'';
 
  587                $dataSection_Content = 
'';
 
  590                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x01),
 
  591                                                           'offset' => array(
'pack' => 
'V'),
 
  592                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x02), 
 
  593                                                           'data'       => array(
'data' => 1252));
 
  594                $dataSection_NumProps++;
 
  597                if($this->_phpExcel->getProperties()->getCategory()){
 
  598                        $dataProp = $this->_phpExcel->getProperties()->getCategory();
 
  599                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x02),
 
  600                                                                   'offset' => array(
'pack' => 
'V'),
 
  601                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x1E),
 
  602                                                                   'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  603                        $dataSection_NumProps++;
 
  606                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x17),
 
  607                                                           'offset' => array(
'pack' => 
'V'),
 
  608                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x03),
 
  609                                                           'data'       => array(
'pack' => 
'V', 
'data' => 0x000C0000));
 
  610                $dataSection_NumProps++;
 
  612                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x0B),
 
  613                                                           'offset' => array(
'pack' => 
'V'),
 
  614                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x0B),
 
  615                                                           'data'       => array(
'data' => 
false));
 
  616                $dataSection_NumProps++;
 
  618                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x10),
 
  619                                                           'offset' => array(
'pack' => 
'V'),
 
  620                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x0B),
 
  621                                                           'data'       => array(
'data' => 
false));
 
  622                $dataSection_NumProps++;
 
  624                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x13),
 
  625                                                           'offset' => array(
'pack' => 
'V'),
 
  626                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x0B),
 
  627                                                           'data'       => array(
'data' => 
false));
 
  628                $dataSection_NumProps++;
 
  630                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x16),
 
  631                                                           'offset' => array(
'pack' => 
'V'),
 
  632                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x0B),
 
  633                                                           'data'       => array(
'data' => 
false));
 
  634                $dataSection_NumProps++;
 
  640                $dataProp = pack(
'v', 0x0001);
 
  641                $dataProp .= pack(
'v', 0x0000);
 
  644                  $dataProp .= pack(
'v', 0x000A);
 
  645                  $dataProp .= pack(
'v', 0x0000);
 
  647                  $dataProp .= 
'Worksheet'.chr(0);
 
  649                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x0D),
 
  650                                                           'offset' => array(
'pack' => 
'V'),
 
  651                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x101E),
 
  652                                                           'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  653                $dataSection_NumProps++;
 
  658                  $dataProp = pack(
'v', 0x0002);
 
  659                  $dataProp .= pack(
'v', 0x0000);
 
  663                      $dataProp .= pack(
'v', 0x001E);
 
  665                      $dataProp .= pack(
'v', 0x0000);
 
  668                        $dataProp .= pack(
'v', 0x0013);
 
  669                        $dataProp .= pack(
'v', 0x0000);
 
  671                        $dataProp .= 
'Feuilles de calcul';
 
  674                      $dataProp .= pack(
'v', 0x0300);
 
  676                      $dataProp .= pack(
'v', 0x0000);
 
  678                      $dataProp .= pack(
'v', 0x0100);
 
  679                      $dataProp .= pack(
'v', 0x0000);
 
  680                          $dataProp .= pack(
'v', 0x0000);
 
  681                      $dataProp .= pack(
'v', 0x0000);
 
  683        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x0C),
 
  684                                                   'offset' => array(
'pack' => 
'V'),
 
  685                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x100C),
 
  686                                                   'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  687        $dataSection_NumProps++;
 
  692                $dataSection_Content_Offset = 8 + $dataSection_NumProps * 8;
 
  693                foreach ($dataSection as $dataProp){
 
  695                        $dataSection_Summary .= pack($dataProp[
'summary'][
'pack'], $dataProp[
'summary'][
'data']);
 
  697                        $dataSection_Summary .= pack($dataProp[
'offset'][
'pack'], $dataSection_Content_Offset);
 
  699                        $dataSection_Content .= pack($dataProp[
'type'][
'pack'], $dataProp[
'type'][
'data']);
 
  701                        if($dataProp[
'type'][
'data'] == 0x02){ 
 
  702                                $dataSection_Content .= pack(
'V', $dataProp[
'data'][
'data']);
 
  704                                $dataSection_Content_Offset += 4 + 4;
 
  706                        elseif($dataProp[
'type'][
'data'] == 0x03){ 
 
  707                                $dataSection_Content .= pack(
'V', $dataProp[
'data'][
'data']);
 
  709                                $dataSection_Content_Offset += 4 + 4;
 
  711                        elseif($dataProp[
'type'][
'data'] == 0x0B){ 
 
  712                                if($dataProp[
'data'][
'data'] == 
false){
 
  713                                        $dataSection_Content .= pack(
'V', 0x0000);
 
  715                                        $dataSection_Content .= pack(
'V', 0x0001);
 
  717                                $dataSection_Content_Offset += 4 + 4;
 
  719                        elseif($dataProp[
'type'][
'data'] == 0x1E){ 
 
  721                                $dataProp[
'data'][
'data'] .= chr(0);
 
  722                                $dataProp[
'data'][
'length'] += 1;
 
  724                                $dataProp[
'data'][
'length'] = $dataProp[
'data'][
'length'] + ((4 - $dataProp[
'data'][
'length'] % 4)==4 ? 0 : (4 - $dataProp[
'data'][
'length'] % 4));
 
  725                                $dataProp[
'data'][
'data'] = str_pad($dataProp[
'data'][
'data'], $dataProp[
'data'][
'length'], chr(0), STR_PAD_RIGHT);
 
  727                                $dataSection_Content .= pack(
'V', $dataProp[
'data'][
'length']);
 
  728                                $dataSection_Content .= $dataProp[
'data'][
'data'];
 
  730                                $dataSection_Content_Offset += 4 + 4 + strlen($dataProp[
'data'][
'data']);
 
  732                        elseif($dataProp[
'type'][
'data'] == 0x40){ 
 
  733                                $dataSection_Content .= $dataProp[
'data'][
'data'];
 
  735                                $dataSection_Content_Offset += 4 + 8;
 
  739                                $dataSection_Content .= $dataProp[
'data'][
'data'];
 
  741                                $dataSection_Content_Offset += 4 + $dataProp[
'data'][
'length'];
 
  749                $data .= pack(
'V', $dataSection_Content_Offset);
 
  751                $data .= pack(
'V', $dataSection_NumProps);
 
  753                $data .= $dataSection_Summary;
 
  755                $data .= $dataSection_Content;
 
  766                $data = pack(
'v', 0xFFFE);
 
  768                $data .= pack(
'v', 0x0000);
 
  770                $data .= pack(
'v', 0x0106);
 
  772                $data .= pack(
'v', 0x0002);
 
  774                $data .= pack(
'VVVV', 0x00, 0x00, 0x00, 0x00);
 
  776                $data .= pack(
'V', 0x0001);
 
  779                $data .= pack(
'vvvvvvvv', 0x85E0, 0xF29F, 0x4FF9, 0x1068, 0x91AB, 0x0008, 0x272B, 0xD9B3);
 
  781                $data .= pack(
'V', 0x30);
 
  784                $dataSection = array();
 
  785                $dataSection_NumProps = 0;
 
  786                $dataSection_Summary = 
'';
 
  787                $dataSection_Content = 
'';
 
  790                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x01),
 
  791                                                           'offset' => array(
'pack' => 
'V'),
 
  792                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x02), 
 
  793                                                           'data'       => array(
'data' => 1252));
 
  794                $dataSection_NumProps++;
 
  797                if($this->_phpExcel->getProperties()->getTitle()){
 
  798                        $dataProp = $this->_phpExcel->getProperties()->getTitle();
 
  799                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x02),
 
  800                                                                   'offset' => array(
'pack' => 
'V'),
 
  801                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x1E), 
 
  802                                                                   'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  803                        $dataSection_NumProps++;
 
  806                if($this->_phpExcel->getProperties()->getSubject()){
 
  807                        $dataProp = $this->_phpExcel->getProperties()->getSubject();
 
  808                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x03),
 
  809                                                                   'offset' => array(
'pack' => 
'V'),
 
  810                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x1E), 
 
  811                                                                   'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  812                        $dataSection_NumProps++;
 
  815                if($this->_phpExcel->getProperties()->getCreator()){
 
  816                        $dataProp = $this->_phpExcel->getProperties()->getCreator();
 
  817                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x04),
 
  818                                                                   'offset' => array(
'pack' => 
'V'),
 
  819                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x1E), 
 
  820                                                                   'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  821                        $dataSection_NumProps++;
 
  824                if($this->_phpExcel->getProperties()->getKeywords()){
 
  825                        $dataProp = $this->_phpExcel->getProperties()->getKeywords();
 
  826                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x05),
 
  827                                                                   'offset' => array(
'pack' => 
'V'),
 
  828                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x1E), 
 
  829                                                                   'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  830                        $dataSection_NumProps++;
 
  833                if($this->_phpExcel->getProperties()->getDescription()){
 
  834                        $dataProp = $this->_phpExcel->getProperties()->getDescription();
 
  835                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x06),
 
  836                                                                   'offset' => array(
'pack' => 
'V'),
 
  837                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x1E), 
 
  838                                                                   'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  839                        $dataSection_NumProps++;
 
  842                if($this->_phpExcel->getProperties()->getLastModifiedBy()){
 
  843                        $dataProp = $this->_phpExcel->getProperties()->getLastModifiedBy();
 
  844                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x08),
 
  845                                                                   'offset' => array(
'pack' => 
'V'),
 
  846                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x1E), 
 
  847                                                                   'data'       => array(
'data' => $dataProp, 
'length' => strlen($dataProp)));
 
  848                        $dataSection_NumProps++;
 
  851                if($this->_phpExcel->getProperties()->getCreated()){
 
  852                        $dataProp = $this->_phpExcel->getProperties()->getCreated();
 
  853                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x0C),
 
  854                                                                   'offset' => array(
'pack' => 
'V'),
 
  855                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x40), 
 
  857                        $dataSection_NumProps++;
 
  860                if($this->_phpExcel->getProperties()->getModified()){
 
  861                        $dataProp = $this->_phpExcel->getProperties()->getModified();
 
  862                        $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x0D),
 
  863                                                                   'offset' => array(
'pack' => 
'V'),
 
  864                                                                   'type'       => array(
'pack' => 
'V', 
'data' => 0x40), 
 
  866                        $dataSection_NumProps++;
 
  869                $dataSection[] = array(
'summary'=> array(
'pack' => 
'V', 
'data' => 0x13),
 
  870                                                           'offset' => array(
'pack' => 
'V'),
 
  871                                                           'type'       => array(
'pack' => 
'V', 
'data' => 0x03), 
 
  872                                                           'data'       => array(
'data' => 0x00));
 
  873                $dataSection_NumProps++;
 
  879                $dataSection_Content_Offset = 8 + $dataSection_NumProps * 8;
 
  880                foreach ($dataSection as $dataProp){
 
  882                        $dataSection_Summary .= pack($dataProp[
'summary'][
'pack'], $dataProp[
'summary'][
'data']);
 
  884                        $dataSection_Summary .= pack($dataProp[
'offset'][
'pack'], $dataSection_Content_Offset);
 
  886                        $dataSection_Content .= pack($dataProp[
'type'][
'pack'], $dataProp[
'type'][
'data']);
 
  888                        if($dataProp[
'type'][
'data'] == 0x02){ 
 
  889                                $dataSection_Content .= pack(
'V', $dataProp[
'data'][
'data']);
 
  891                                $dataSection_Content_Offset += 4 + 4;
 
  893                        elseif($dataProp[
'type'][
'data'] == 0x03){ 
 
  894                                $dataSection_Content .= pack(
'V', $dataProp[
'data'][
'data']);
 
  896                                $dataSection_Content_Offset += 4 + 4;
 
  898                        elseif($dataProp[
'type'][
'data'] == 0x1E){ 
 
  900                                $dataProp[
'data'][
'data'] .= chr(0);
 
  901                                $dataProp[
'data'][
'length'] += 1;
 
  903                                $dataProp[
'data'][
'length'] = $dataProp[
'data'][
'length'] + ((4 - $dataProp[
'data'][
'length'] % 4)==4 ? 0 : (4 - $dataProp[
'data'][
'length'] % 4));
 
  904                                $dataProp[
'data'][
'data'] = str_pad($dataProp[
'data'][
'data'], $dataProp[
'data'][
'length'], chr(0), STR_PAD_RIGHT);
 
  906                                $dataSection_Content .= pack(
'V', $dataProp[
'data'][
'length']);
 
  907                                $dataSection_Content .= $dataProp[
'data'][
'data'];
 
  909                                $dataSection_Content_Offset += 4 + 4 + strlen($dataProp[
'data'][
'data']);
 
  911                        elseif($dataProp[
'type'][
'data'] == 0x40){ 
 
  912                                $dataSection_Content .= $dataProp[
'data'][
'data'];
 
  914                                $dataSection_Content_Offset += 4 + 8;
 
  925                $data .= pack(
'V', $dataSection_Content_Offset);
 
  927                $data .= pack(
'V', $dataSection_NumProps);
 
  929                $data .= $dataSection_Summary;
 
  931                $data .= $dataSection_Content;
 
An exception for terminatinating execution or to throw for unit testing.
static getReturnDateType()
static setReturnDateType($returnDateType)
static getInstance(PHPExcel $workbook=NULL)
Get an instance of this class.
static stringFromColumnIndex($pColumnIndex=0)
String from columnindex.
static rangeBoundaries($pRange='A1:A1')
Calculate range boundaries.
static imagecreatefrombmp($p_sFile)
Create a new image from file.
static oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height)
Convert 1-cell anchor coordinates to 2-cell anchor coordinates This function is ported from PEAR Spre...
static Asc2Ucs($ascii)
Utility function to transform ASCII text to Unicode.
static LocalDate2OLE($date=null)
Utility function Returns a string for the OLE container with the date given.
_writeDocumentSummaryInformation()
Build the OLE Part for DocumentSummary Information.
__construct(PHPExcel $phpExcel)
Create a new PHPExcel_Writer_Excel5.
$_documentSummaryInformation
save($pFilename=null)
Save PHPExcel to file.
setTempDir($pValue='')
Set temporary storage directory.
_writeSummaryInformation()
Build the OLE Part for Summary Information.
_buildWorksheetEschers()
Build the Worksheet Escher objects.
_buildWorkbookEscher()
Build the Escher object corresponding to the MSODRAWINGGROUP record.
foreach($_POST as $key=> $value) $res