Ejemplo n.º 1
0
 /**
  */
 public function testDegreesAngle()
 {
     $value = rand(1, 100);
     $this->assertEquals(0, Drawing::degreesToAngle());
     $this->assertEquals((int) round($value * 60000), Drawing::degreesToAngle($value));
     $this->assertEquals(0, Drawing::angleToDegrees());
     $this->assertEquals(round($value / 60000), Drawing::angleToDegrees($value));
 }
Ejemplo n.º 2
0
 /**
  * @param Chart $chart
  */
 private function writeTitle(Chart $chart)
 {
     // chart:title
     $this->xmlContent->startElement('chart:title');
     $this->xmlContent->writeAttribute('svg:x', String::numberFormat(SharedDrawing::pixelsToCentimeters($chart->getTitle()->getOffsetX()), 3) . 'cm');
     $this->xmlContent->writeAttribute('svg:y', String::numberFormat(SharedDrawing::pixelsToCentimeters($chart->getTitle()->getOffsetY()), 3) . 'cm');
     $this->xmlContent->writeAttribute('chart:style-name', 'styleTitle');
     // > text:p
     $this->xmlContent->startElement('text:p');
     $this->xmlContent->text($chart->getTitle()->getText());
     // > text:p
     $this->xmlContent->endElement();
     // > chart:title
     $this->xmlContent->endElement();
 }
Ejemplo n.º 3
0
 /**
  * Write Meta file to XML format
  *
  * @param  PHPPowerPoint $pPHPPowerPoint
  * @return string        XML Output
  * @throws \Exception
  */
 public function writePart(PHPPowerPoint $pPHPPowerPoint)
 {
     // Create XML writer
     $objWriter = $this->getXMLWriter();
     // XML header
     $objWriter->startDocument('1.0', 'UTF-8');
     // office:document-meta
     $objWriter->startElement('office:document-styles');
     $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
     $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
     $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
     $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
     $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
     $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
     $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
     $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
     $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
     $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
     $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
     $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
     $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
     $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
     $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
     $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
     $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
     $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
     $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
     $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
     $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
     $objWriter->writeAttribute('xmlns:smil', 'urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0');
     $objWriter->writeAttribute('xmlns:anim', 'urn:oasis:names:tc:opendocument:xmlns:animation:1.0');
     $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
     $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
     $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
     $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
     $objWriter->writeAttribute('xmlns:officeooo', 'http://openoffice.org/2009/office');
     $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
     $objWriter->writeAttribute('xmlns:drawooo', 'http://openoffice.org/2010/draw');
     $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
     $objWriter->writeAttribute('office:version', '1.2');
     // Variables
     $stylePageLayout = $pPHPPowerPoint->getLayout()->getDocumentLayout();
     // office:styles
     $objWriter->startElement('office:styles');
     // style:style
     $objWriter->startElement('style:style');
     $objWriter->writeAttribute('style:name', 'sPres0');
     $objWriter->writeAttribute('style:display-name', 'sPres0');
     $objWriter->writeAttribute('style:family', 'presentation');
     // style:graphic-properties
     $objWriter->startElement('style:graphic-properties');
     $objWriter->writeAttribute('draw:fill-color', '#ffffff');
     // > style:graphic-properties
     $objWriter->endElement();
     // > style:style
     $objWriter->endElement();
     // draw:gradient
     $arrayGradient = array();
     foreach ($pPHPPowerPoint->getAllSlides() as $slide) {
         foreach ($slide->getShapeCollection() as $shape) {
             if ($shape instanceof Table) {
                 foreach ($shape->getRows() as $row) {
                     foreach ($row->getCells() as $cell) {
                         if ($cell->getFill()->getFillType() == Fill::FILL_GRADIENT_LINEAR) {
                             if (!in_array($cell->getFill()->getHashCode(), $arrayGradient)) {
                                 $objWriter->startElement('draw:gradient');
                                 $objWriter->writeAttribute('draw:name', 'gradient_' . $cell->getFill()->getHashCode());
                                 $objWriter->writeAttribute('draw:display-name', 'gradient_' . $cell->getFill()->getHashCode());
                                 $objWriter->writeAttribute('draw:style', 'linear');
                                 $objWriter->writeAttribute('draw:start-intensity', '100%');
                                 $objWriter->writeAttribute('draw:end-intensity', '100%');
                                 $objWriter->writeAttribute('draw:start-color', '#' . $cell->getFill()->getStartColor()->getRGB());
                                 $objWriter->writeAttribute('draw:end-color', '#' . $cell->getFill()->getEndColor()->getRGB());
                                 $objWriter->writeAttribute('draw:border', '0%');
                                 $objWriter->writeAttribute('draw:angle', $cell->getFill()->getRotation() - 90);
                                 $objWriter->endElement();
                                 $arrayGradient[] = $cell->getFill()->getHashCode();
                             }
                         }
                     }
                 }
             }
         }
     }
     // > office:styles
     $objWriter->endElement();
     // office:automatic-styles
     $objWriter->startElement('office:automatic-styles');
     // style:page-layout
     $objWriter->startElement('style:page-layout');
     if (empty($stylePageLayout)) {
         $objWriter->writeAttribute('style:name', 'sPL0');
     } else {
         $objWriter->writeAttribute('style:name', $stylePageLayout);
     }
     // style:page-layout-properties
     $objWriter->startElement('style:page-layout-properties');
     $objWriter->writeAttribute('fo:margin-top', '0cm');
     $objWriter->writeAttribute('fo:margin-bottom', '0cm');
     $objWriter->writeAttribute('fo:margin-left', '0cm');
     $objWriter->writeAttribute('fo:margin-right', '0cm');
     $objWriter->writeAttribute('fo:page-width', String::numberFormat(SharedDrawing::pixelsToCentimeters(SharedDrawing::emuToPixels($pPHPPowerPoint->getLayout()->getCX())), 1) . 'cm');
     $objWriter->writeAttribute('fo:page-height', String::numberFormat(SharedDrawing::pixelsToCentimeters(SharedDrawing::emuToPixels($pPHPPowerPoint->getLayout()->getCY())), 1) . 'cm');
     if ($pPHPPowerPoint->getLayout()->getCX() > $pPHPPowerPoint->getLayout()->getCY()) {
         $objWriter->writeAttribute('style:print-orientation', 'landscape');
     } else {
         $objWriter->writeAttribute('style:print-orientation', 'portrait');
     }
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // office:master-styles
     $objWriter->startElement('office:master-styles');
     // style:master-page
     $objWriter->startElement('style:master-page');
     $objWriter->writeAttribute('style:name', 'Standard');
     $objWriter->writeAttribute('style:display-name', 'Standard');
     if (empty($stylePageLayout)) {
         $objWriter->writeAttribute('style:page-layout-name', 'sPL0');
     } else {
         $objWriter->writeAttribute('style:page-layout-name', $stylePageLayout);
     }
     $objWriter->writeAttribute('draw:style-name', 'sPres0');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // Return
     return $objWriter->getData();
 }
Ejemplo n.º 4
0
 /**
  * Write Legend
  *
  * @param  \PhpOffice\PhpPowerpoint\Shared\XMLWriter   $objWriter XML Writer
  * @param  \PhpOffice\PhpPowerpoint\Shape\Chart\Legend $subject
  * @throws \Exception
  */
 protected function writeLegend(XMLWriter $objWriter, Legend $subject)
 {
     // c:legend
     $objWriter->startElement('c:legend');
     // c:legendPos
     $objWriter->startElement('c:legendPos');
     $objWriter->writeAttribute('val', $subject->getPosition());
     $objWriter->endElement();
     // Write layout
     $this->writeLayout($objWriter, $subject);
     // c:overlay
     $objWriter->startElement('c:overlay');
     $objWriter->writeAttribute('val', '0');
     $objWriter->endElement();
     // c:spPr
     $objWriter->startElement('c:spPr');
     // Fill
     $this->writeFill($objWriter, $subject->getFill());
     // Border
     if ($subject->getBorder()->getLineStyle() != Border::LINE_NONE) {
         $this->writeBorder($objWriter, $subject->getBorder(), '');
     }
     $objWriter->endElement();
     // c:txPr
     $objWriter->startElement('c:txPr');
     // a:bodyPr
     $objWriter->writeElement('a:bodyPr', null);
     // a:lstStyle
     $objWriter->writeElement('a:lstStyle', null);
     // a:p
     $objWriter->startElement('a:p');
     // a:pPr
     $objWriter->startElement('a:pPr');
     $objWriter->writeAttribute('algn', $subject->getAlignment()->getHorizontal());
     $objWriter->writeAttribute('fontAlgn', $subject->getAlignment()->getVertical());
     $objWriter->writeAttribute('marL', SharedDrawing::pixelsToEmu($subject->getAlignment()->getMarginLeft()));
     $objWriter->writeAttribute('marR', SharedDrawing::pixelsToEmu($subject->getAlignment()->getMarginRight()));
     $objWriter->writeAttribute('indent', SharedDrawing::pixelsToEmu($subject->getAlignment()->getIndent()));
     $objWriter->writeAttribute('lvl', $subject->getAlignment()->getLevel());
     // a:defRPr
     $objWriter->startElement('a:defRPr');
     $objWriter->writeAttribute('b', $subject->getFont()->isBold() ? 'true' : 'false');
     $objWriter->writeAttribute('i', $subject->getFont()->isItalic() ? 'true' : 'false');
     $objWriter->writeAttribute('strike', $subject->getFont()->isStrikethrough() ? 'sngStrike' : 'noStrike');
     $objWriter->writeAttribute('sz', $subject->getFont()->getSize() * 100);
     $objWriter->writeAttribute('u', $subject->getFont()->getUnderline());
     if ($subject->getFont()->isSuperScript() || $subject->getFont()->isSubScript()) {
         if ($subject->getFont()->isSuperScript()) {
             $objWriter->writeAttribute('baseline', '30000');
         } elseif ($subject->getFont()->isSubScript()) {
             $objWriter->writeAttribute('baseline', '-25000');
         }
     }
     // Font - a:solidFill
     $objWriter->startElement('a:solidFill');
     // a:srgbClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', $subject->getFont()->getColor()->getRGB());
     $objWriter->endElement();
     $objWriter->endElement();
     // Font - a:latin
     $objWriter->startElement('a:latin');
     $objWriter->writeAttribute('typeface', $subject->getFont()->getName());
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:endParaRPr
     $objWriter->startElement('a:endParaRPr');
     $objWriter->writeAttribute('lang', 'en-US');
     $objWriter->writeAttribute('dirty', '0');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
 }
Ejemplo n.º 5
0
 /**
  * Write Gradient Fill
  *
  * @param  \PhpOffice\PhpPowerpoint\Shared\XMLWriter $objWriter XML Writer
  * @param  \PhpOffice\PhpPowerpoint\Style\Fill       $pFill     Fill style
  * @throws \Exception
  */
 protected function writeGradientFill(XMLWriter $objWriter, Fill $pFill)
 {
     // a:gradFill
     $objWriter->startElement('a:gradFill');
     // a:gsLst
     $objWriter->startElement('a:gsLst');
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '0');
     // srgbClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', $pFill->getStartColor()->getRGB());
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '100000');
     // srgbClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', $pFill->getEndColor()->getRGB());
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:lin
     $objWriter->startElement('a:lin');
     $objWriter->writeAttribute('ang', SharedDrawing::degreesToAngle($pFill->getRotation()));
     $objWriter->writeAttribute('scaled', '0');
     $objWriter->endElement();
     $objWriter->endElement();
 }
Ejemplo n.º 6
0
 /**
  * Write table Chart
  * @param XMLWriter $objWriter
  * @param Chart $shape
  * @param integer $shapeId
  */
 public function writeShapeChart(XMLWriter $objWriter, Chart $shape, $shapeId)
 {
     $parentWriter = $this->getParentWriter();
     if (!$parentWriter instanceof ODPresentation) {
         throw new \Exception('The $parentWriter is not an instance of \\PhpOffice\\PhpPowerpoint\\Writer\\ODPresentation');
     }
     $parentWriter->chartArray[$shapeId] = $shape;
     // draw:frame
     $objWriter->startElement('draw:frame');
     $objWriter->writeAttribute('draw:name', $shape->getTitle()->getText());
     $objWriter->writeAttribute('svg:x', StringHelper::numberFormat(SharedDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm');
     $objWriter->writeAttribute('svg:y', StringHelper::numberFormat(SharedDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm');
     $objWriter->writeAttribute('svg:height', StringHelper::numberFormat(SharedDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm');
     $objWriter->writeAttribute('svg:width', StringHelper::numberFormat(SharedDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm');
     // draw:object
     $objWriter->startElement('draw:object');
     $objWriter->writeAttribute('xlink:href', './Object ' . $shapeId);
     $objWriter->writeAttribute('xlink:type', 'simple');
     $objWriter->writeAttribute('xlink:show', 'embed');
     // > draw:object
     $objWriter->endElement();
     // > draw:frame
     $objWriter->endElement();
 }
Ejemplo n.º 7
0
 /**
  * Write table Chart
  * @param XMLWriter $objWriter
  * @param Chart $shape
  * @param integer $shapeId
  */
 public function writeShapeChart(XMLWriter $objWriter, Chart $shape, $shapeId)
 {
     $this->getParentWriter()->chartArray[$shapeId] = $shape;
     // draw:frame
     $objWriter->startElement('draw:frame');
     $objWriter->writeAttribute('draw:name', $shape->getTitle()->getText());
     $objWriter->writeAttribute('svg:x', String::numberFormat(SharedDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm');
     $objWriter->writeAttribute('svg:y', String::numberFormat(SharedDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm');
     $objWriter->writeAttribute('svg:height', String::numberFormat(SharedDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm');
     $objWriter->writeAttribute('svg:width', String::numberFormat(SharedDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm');
     // draw:object
     $objWriter->startElement('draw:object');
     $objWriter->writeAttribute('xlink:href', './Object ' . $shapeId);
     $objWriter->writeAttribute('xlink:type', 'simple');
     $objWriter->writeAttribute('xlink:show', 'embed');
     // > draw:object
     $objWriter->endElement();
     // > draw:frame
     $objWriter->endElement();
 }
Ejemplo n.º 8
0
 /**
  * SlideContainer
  * @link http://msdn.microsoft.com/en-us/library/dd946323(v=office.12).aspx
  * @param int $pos
  */
 private function readRTSlide($pos)
 {
     $oSlide = $this->oPhpPowerpoint->createSlide();
     // echo '@slide'.EOL;
     // *** slideAtom (32 bytes)
     // slideAtom > rh
     $rHeader = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
     $pos += 8;
     if ($rHeader['recVer'] != 0x2 || $rHeader['recInstance'] != 0x0 || $rHeader['recType'] != self::RT_SLIDEATOM) {
         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > RecordHeader).');
     }
     // slideAtom > geom
     $pos += 4;
     // slideAtom > rgPlaceholderTypes
     $rgPlaceholderTypes = array();
     for ($inc = 0; $inc < 8; $inc++) {
         $rgPlaceholderTypes[] = self::getInt1d($this->streamPowerpointDocument, $pos);
         $pos += 1;
     }
     // slideAtom > masterIdRef
     $pos += 4;
     // slideAtom > notesIdRef
     $pos += 4;
     // slideAtom > slideFlags
     $pos += 2;
     // slideAtom > unused;
     $pos += 2;
     // *** slideShowSlideInfoAtom (24 bytes)
     $pos += 24;
     // perSlideHFContainer (variable)
     // perSlideHFContainer > rh
     $rHeader = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
     $pos += 8;
     if ($rHeader['recVer'] != 0xf || $rHeader['recInstance'] != 0x0 || $rHeader['recType'] != self::RT_HEADERSFOOTERS) {
         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > perSlideHFContainer > RT_HeadersFooters).');
     }
     $pos += $rHeader['recLen'];
     // *** rtSlideSyncInfo12 (variable)
     // *** drawing (variable)
     // drawing > rh
     $rHeader = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
     $pos += 8;
     if ($rHeader['recVer'] != 0xf || $rHeader['recInstance'] != 0x0 || $rHeader['recType'] != self::RT_DRAWING) {
         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > drawing > rh).');
     }
     // print_r('@PPDrawing'.EOL);
     // drawing > OfficeArtDg
     // drawing > OfficeArtDg > rh
     $rHeader = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
     $pos += 8;
     if ($rHeader['recVer'] != 0xf || $rHeader['recInstance'] != 0x0 || $rHeader['recType'] != 0xf002) {
         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > drawing > OfficeArtDg > rh).');
     }
     // drawing > OfficeArtDg > drawingData
     // drawing > OfficeArtDg > drawingData > rh
     $rHeader = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
     $pos += 8;
     if ($rHeader['recVer'] != 0x0 || $rHeader['recInstance'] >= 0xffe || $rHeader['recType'] != 0xf008 || $rHeader['recLen'] != 0x8) {
         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > drawing > OfficeArtDg > drawingData > rh).');
     }
     // drawing > OfficeArtDg > drawingData > csp
     $pos += 4;
     // drawing > OfficeArtDg > drawingData > spidCur
     $pos += 4;
     // drawing > OfficeArtDg > groupShape
     // drawing > OfficeArtDg > groupShape > rh
     $rHeader = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
     $pos += 8;
     if ($rHeader['recVer'] != 0xf || $rHeader['recInstance'] >= 0xf000 || $rHeader['recType'] != 0xf003) {
         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > drawing > OfficeArtDg > groupShape > rh).');
     }
     // drawing > OfficeArtDg > groupShape > rgfb
     do {
         $shape = null;
         $arrShpPrimaryOpt = array();
         $arrClientAnchor = array();
         $arrClientTextBox = array();
         $arrClientTextBox['hyperlink'] = array();
         $arrClientTextBox['text'] = '';
         $arrClientTextBox['numParts'] = 0;
         $arrClientTextBox['numTexts'] = 0;
         $rhFB = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
         $pos += 8;
         $rHeader['recLen'] -= 8;
         // print_r(EOL);
         // print_r($rhFB);
         // print_r(EOL);
         if ($rhFB['recVer'] != 0xf || $rhFB['recInstance'] != 0x0 || $rhFB['recType'] != 0xf003 && $rhFB['recType'] != 0xf004) {
             throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > drawing > OfficeArtDg > groupShape > rgfb).');
         }
         switch ($rhFB['recType']) {
             case 0xf003:
                 // OfficeArtSpgrContainer
                 // OfficeArtSpgrContainer
                 // print_r('@OfficeArtSpgrContainer'.EOL);
                 break;
             case 0xf004:
                 // OfficeArtSpContainer
                 // shapeGroup
                 $shapeGroup = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 if ($shapeGroup['recVer'] == 0x1 && $shapeGroup['recInstance'] == 0x0 && $shapeGroup['recType'] == 0xf009 && $shapeGroup['recLen'] == 0x10) {
                     // print_r('$shapeGroup'.EOL);
                     $pos += 8;
                     $rHeader['recLen'] -= 8;
                     $arrShapeGroup['xLeft'] = self::getInt4d($this->streamPowerpointDocument, $pos);
                     $pos += 4;
                     $rHeader['recLen'] -= 4;
                     $arrShapeGroup['yTop'] = self::getInt4d($this->streamPowerpointDocument, $pos);
                     $pos += 4;
                     $rHeader['recLen'] -= 4;
                     $arrShapeGroup['xRight'] = self::getInt4d($this->streamPowerpointDocument, $pos);
                     $pos += 4;
                     $rHeader['recLen'] -= 4;
                     $arrShapeGroup['yBottom'] = self::getInt4d($this->streamPowerpointDocument, $pos);
                     $pos += 4;
                     $rHeader['recLen'] -= 4;
                 }
                 // shapeProp
                 $shapeProp = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 if ($shapeProp['recVer'] == 0x2 && $shapeProp['recType'] == 0xf00a && $shapeProp['recLen'] == 0x8) {
                     $pos += 8;
                     $rHeader['recLen'] -= 8;
                     // print_r('$shapeProp'.EOL);
                     // spid
                     $pos += 4;
                     $rHeader['recLen'] -= 4;
                     // data
                     $pos += 4;
                     $rHeader['recLen'] -= 4;
                 }
                 // shapePrimaryOptions
                 $shapePrimaryOptions = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 if ($shapePrimaryOptions['recVer'] == 0x3 && $shapePrimaryOptions['recType'] == 0xf00b) {
                     $pos += 8;
                     $rHeader['recLen'] -= 8;
                     // print_r('$shapePrimaryOptions'.EOL);
                     //@link : http://msdn.microsoft.com/en-us/library/dd906086(v=office.12).aspx
                     $officeArtFOPTE = array();
                     for ($inc = 0; $inc < $shapePrimaryOptions['recInstance']; $inc++) {
                         $opid = self::getInt2d($this->streamPowerpointDocument, $pos);
                         $pos += 2;
                         $rHeader['recLen'] -= 2;
                         $shapePrimaryOptions['recLen'] -= 2;
                         $optOp = self::getInt4d($this->streamPowerpointDocument, $pos);
                         $pos += 4;
                         $rHeader['recLen'] -= 4;
                         $shapePrimaryOptions['recLen'] -= 4;
                         $officeArtFOPTE[] = array('opid' => $opid >> 0 & bindec('11111111111111'), 'fBid' => $opid >> 14 & bindec('1'), 'fComplex' => $opid >> 15 & bindec('1'), 'op' => $optOp);
                     }
                     //@link : http://code.metager.de/source/xref/kde/calligra/filters/libmso/OPID
                     foreach ($officeArtFOPTE as $opt) {
                         switch ($opt['opid']) {
                             case 0x7f:
                                 // Transform : Protection Boolean Properties
                                 //@link : http://msdn.microsoft.com/en-us/library/dd909131(v=office.12).aspx
                                 break;
                             case 0x80:
                                 // Text : ltxid
                                 //@link : http://msdn.microsoft.com/en-us/library/dd947446(v=office.12).aspx
                                 break;
                             case 0x81:
                                 // Text : dxTextLeft
                                 //@link : http://msdn.microsoft.com/en-us/library/dd953234(v=office.12).aspx
                                 $arrShpPrimaryOpt['insetLeft'] = \PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']);
                                 break;
                             case 0x82:
                                 // Text : dyTextTop
                                 //@link : http://msdn.microsoft.com/en-us/library/dd925068(v=office.12).aspx
                                 $arrShpPrimaryOpt['insetTop'] = \PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']);
                                 break;
                             case 0x83:
                                 // Text : dxTextRight
                                 //@link : http://msdn.microsoft.com/en-us/library/dd906782(v=office.12).aspx
                                 $arrShpPrimaryOpt['insetRight'] = \PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']);
                                 break;
                             case 0x84:
                                 // Text : dyTextBottom
                                 //@link : http://msdn.microsoft.com/en-us/library/dd772858(v=office.12).aspx
                                 $arrShpPrimaryOpt['insetBottom'] = \PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']);
                                 break;
                             case 0x85:
                                 // Text : WrapText
                                 //@link : http://msdn.microsoft.com/en-us/library/dd924770(v=office.12).aspx
                                 break;
                             case 0x87:
                                 // Text : anchorText
                                 //@link : http://msdn.microsoft.com/en-us/library/dd948575(v=office.12).aspx
                                 break;
                             case 0xbf:
                                 // Text : Text Boolean Properties
                                 //@link : http://msdn.microsoft.com/en-us/library/dd950905(v=office.12).aspx
                                 break;
                             case 0x104:
                                 // Blip : pib
                                 //@link : http://msdn.microsoft.com/en-us/library/dd772837(v=office.12).aspx
                                 if ($opt['fComplex'] == 0) {
                                     $arrShpPrimaryOpt['pib'] = $opt['op'];
                                 } else {
                                     // pib Complex
                                 }
                                 break;
                             case 0x140:
                                 // Geometry : geoLeft
                                 //@link : http://msdn.microsoft.com/en-us/library/dd947489(v=office.12).aspx
                                 // print_r('geoLeft : '.$opt['op'].EOL);
                                 break;
                             case 0x141:
                                 // Geometry : geoTop
                                 //@link : http://msdn.microsoft.com/en-us/library/dd949459(v=office.12).aspx
                                 // print_r('geoTop : '.$opt['op'].EOL);
                                 break;
                             case 0x142:
                                 // Geometry : geoRight
                                 //@link : http://msdn.microsoft.com/en-us/library/dd947117(v=office.12).aspx
                                 // print_r('geoRight : '.$opt['op'].EOL);
                                 break;
                             case 0x143:
                                 // Geometry : geoBottom
                                 //@link : http://msdn.microsoft.com/en-us/library/dd948602(v=office.12).aspx
                                 // print_r('geoBottom : '.$opt['op'].EOL);
                                 break;
                             case 0x144:
                                 // Geometry : shapePath
                                 //@link : http://msdn.microsoft.com/en-us/library/dd945249(v=office.12).aspx
                                 $arrShpPrimaryOpt['line'] = true;
                                 break;
                             case 0x145:
                                 // Geometry : pVertices
                                 //@link : http://msdn.microsoft.com/en-us/library/dd949814(v=office.12).aspx
                                 if ($opt['fComplex'] == 1) {
                                     $pos += $opt['op'];
                                     $rHeader['recLen'] -= $opt['op'];
                                     $shapePrimaryOptions['recLen'] -= $opt['op'];
                                 }
                                 break;
                             case 0x146:
                                 // Geometry : pSegmentInfo
                                 //@link : http://msdn.microsoft.com/en-us/library/dd905742(v=office.12).aspx
                                 if ($opt['fComplex'] == 1) {
                                     $pos += $opt['op'];
                                     $rHeader['recLen'] -= $opt['op'];
                                     $shapePrimaryOptions['recLen'] -= $opt['op'];
                                 }
                                 break;
                             case 0x155:
                                 // Geometry : pAdjustHandles
                                 //@link : http://msdn.microsoft.com/en-us/library/dd905890(v=office.12).aspx
                                 if ($opt['fComplex'] == 1) {
                                     $pos += $opt['op'];
                                     $rHeader['recLen'] -= $opt['op'];
                                     $shapePrimaryOptions['recLen'] -= $opt['op'];
                                 }
                                 break;
                             case 0x156:
                                 // Geometry : pGuides
                                 //@link : http://msdn.microsoft.com/en-us/library/dd910801(v=office.12).aspx
                                 if ($opt['fComplex'] == 1) {
                                     $pos += $opt['op'];
                                     $rHeader['recLen'] -= $opt['op'];
                                     $shapePrimaryOptions['recLen'] -= $opt['op'];
                                 }
                                 break;
                             case 0x157:
                                 // Geometry : pInscribe
                                 //@link : http://msdn.microsoft.com/en-us/library/dd904889(v=office.12).aspx
                                 if ($opt['fComplex'] == 1) {
                                     $pos += $opt['op'];
                                     $rHeader['recLen'] -= $opt['op'];
                                     $shapePrimaryOptions['recLen'] -= $opt['op'];
                                 }
                                 break;
                             case 0x17f:
                                 // Geometry Boolean Properties
                                 //@link : http://msdn.microsoft.com/en-us/library/dd944968(v=office.12).aspx
                                 break;
                             case 0x180:
                                 // Fill : fillType
                                 //@link : http://msdn.microsoft.com/en-us/library/dd947909(v=office.12).aspx
                                 break;
                             case 0x181:
                                 // Fill : fillColor
                                 //@link : http://msdn.microsoft.com/en-us/library/dd921332(v=office.12).aspx
                                 $red = $opt['op'] >> 0 & bindec('11111111');
                                 $green = $opt['op'] >> 8 & bindec('11111111');
                                 $blue = $opt['op'] >> 16 & bindec('11111111');
                                 $strColor = str_pad(dechex($red), 2, STR_PAD_LEFT, '0');
                                 $strColor .= str_pad(dechex($green), 2, STR_PAD_LEFT, '0');
                                 $strColor .= str_pad(dechex($blue), 2, STR_PAD_LEFT, '0');
                                 // echo 'fillColor  : '.$strColor.EOL;
                                 break;
                             case 0x183:
                                 // Fill : fillBackColor
                                 //@link : http://msdn.microsoft.com/en-us/library/dd950634(v=office.12).aspx
                                 $red = $opt['op'] >> 0 & bindec('11111111');
                                 $green = $opt['op'] >> 8 & bindec('11111111');
                                 $blue = $opt['op'] >> 16 & bindec('11111111');
                                 $strColor = str_pad(dechex($red), 2, STR_PAD_LEFT, '0');
                                 $strColor .= str_pad(dechex($green), 2, STR_PAD_LEFT, '0');
                                 $strColor .= str_pad(dechex($blue), 2, STR_PAD_LEFT, '0');
                                 // echo 'fillBackColor  : '.$strColor.EOL;
                                 break;
                             case 0x193:
                                 // Fill : fillRectRight
                                 //@link : http://msdn.microsoft.com/en-us/library/dd951294(v=office.12).aspx
                                 // echo 'fillRectRight  : '.\PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']).EOL;
                                 break;
                             case 0x194:
                                 // Fill : fillRectBottom
                                 //@link : http://msdn.microsoft.com/en-us/library/dd910194(v=office.12).aspx
                                 // echo 'fillRectBottom   : '.\PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']).EOL;
                                 break;
                             case 0x1bf:
                                 // Fill : Fill Style Boolean Properties
                                 //@link : http://msdn.microsoft.com/en-us/library/dd909380(v=office.12).aspx
                                 break;
                             case 0x1c0:
                                 // Line Style : lineColor
                                 //@link : http://msdn.microsoft.com/en-us/library/dd920397(v=office.12).aspx
                                 $red = $opt['op'] >> 0 & bindec('11111111');
                                 $green = $opt['op'] >> 8 & bindec('11111111');
                                 $blue = $opt['op'] >> 16 & bindec('11111111');
                                 $strColor = str_pad(dechex($red), 2, STR_PAD_LEFT, '0');
                                 $strColor .= str_pad(dechex($green), 2, STR_PAD_LEFT, '0');
                                 $strColor .= str_pad(dechex($blue), 2, STR_PAD_LEFT, '0');
                                 $arrShpPrimaryOpt['lineColor'] = $strColor;
                                 break;
                             case 0x1c1:
                                 // Line Style : lineOpacity
                                 //@link : http://msdn.microsoft.com/en-us/library/dd923433(v=office.12).aspx
                                 // echo 'lineOpacity : '.dechex($opt['op']).EOL;
                                 break;
                             case 0x1c2:
                                 // Line Style : lineBackColor
                                 //@link : http://msdn.microsoft.com/en-us/library/dd947669(v=office.12).aspx
                                 break;
                             case 0x1cb:
                                 // Line Style : lineWidth
                                 //@link : http://msdn.microsoft.com/en-us/library/dd926964(v=office.12).aspx
                                 $arrShpPrimaryOpt['lineWidth'] = \PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']);
                                 break;
                             case 0x1d6:
                                 // Line Style : lineJoinStyle
                                 //@link : http://msdn.microsoft.com/en-us/library/dd909643(v=office.12).aspx
                                 break;
                             case 0x1d7:
                                 // Line Style : lineEndCapStyle
                                 //@link : http://msdn.microsoft.com/en-us/library/dd925071(v=office.12).aspx
                                 break;
                             case 0x1ff:
                                 // Line Style : Line Style Boolean Properties
                                 //@link : http://msdn.microsoft.com/en-us/library/dd951605(v=office.12).aspx
                                 break;
                             case 0x201:
                                 // Shadow Style : shadowColor
                                 //@link : http://msdn.microsoft.com/en-us/library/dd923454(v=office.12).aspx
                                 break;
                             case 0x204:
                                 // Shadow Style : shadowOpacity
                                 //@link : http://msdn.microsoft.com/en-us/library/dd920720(v=office.12).aspx
                                 break;
                             case 0x205:
                                 // Shadow Style : shadowOffsetX
                                 //@link : http://msdn.microsoft.com/en-us/library/dd945280(v=office.12).aspx
                                 $arrShpPrimaryOpt['shadowOffsetX'] = \PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']);
                                 break;
                             case 0x206:
                                 // Shadow Style : shadowOffsetY
                                 //@link : http://msdn.microsoft.com/en-us/library/dd907855(v=office.12).aspx
                                 $arrShpPrimaryOpt['shadowOffsetY'] = \PhpOffice\PhpPowerpoint\Shared\Drawing::emuToPixels($opt['op']);
                                 break;
                             case 0x23f:
                                 // Shadow Style : Shadow Style Boolean Properties
                                 //@link : http://msdn.microsoft.com/en-us/library/dd947887(v=office.12).aspx
                                 break;
                             case 0x304:
                                 // Shape : bWMode
                                 //@link : http://msdn.microsoft.com/en-us/library/dd947659(v=office.12).aspx
                                 break;
                             case 0x33f:
                                 // Shape Boolean Properties
                                 //@link : http://msdn.microsoft.com/en-us/library/dd951345(v=office.12).aspx
                                 break;
                             default:
                                 throw new \Exception('Feature not implemented (l.' . __LINE__ . ' : ' . dechex($opt['opid'] . ')'));
                                 break;
                         }
                     }
                     $pos += $shapePrimaryOptions['recLen'];
                     $rHeader['recLen'] -= $shapePrimaryOptions['recLen'];
                 }
                 $shpSecondaryOptions1 = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 $bShpSecondaryOpt1 = false;
                 if ($shpSecondaryOptions1['recVer'] == 0x3 && $shpSecondaryOptions1['recType'] == 0xf121) {
                     $pos += 8;
                     $rHeader['recLen'] -= 8;
                     $bShpSecondaryOpt1 = true;
                     // echo '@$rhShapeSecondaryOptions1'.EOL;
                 }
                 $shpTertiaryOptions1 = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 $bShpTertiaryOptions1 = false;
                 if ($shpTertiaryOptions1['recVer'] == 0x3 && $shpTertiaryOptions1['recType'] == 0xf122) {
                     $pos += 8;
                     $rHeader['recLen'] -= 8;
                     $bShpTertiaryOptions1 = true;
                     // echo '@$rhShapeTertiaryOptions1'.EOL;
                 }
                 $rhChildAnchor = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 if ($rhChildAnchor['recVer'] == 0x0 && $rhChildAnchor['recInstance'] == 0x0 && $rhChildAnchor['recType'] == 0xf00f && $rhChildAnchor['recLen'] == 0x10) {
                     $pos += 8;
                     $rHeader['recLen'] -= 8;
                     // echo '@$rhChildAnchor'.EOL;
                 }
                 $rhClientAnchor = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 $pos += 8;
                 $rHeader['recLen'] -= 8;
                 //@link : http://msdn.microsoft.com/en-us/library/dd922797(v=office.12).aspx
                 if ($rhClientAnchor['recVer'] == 0x0 && $rhClientAnchor['recInstance'] == 0x0 && $rhClientAnchor['recType'] == 0xf010 && ($rhClientAnchor['recLen'] == 0x8 || $rhClientAnchor['recLen'] == 0x10)) {
                     // echo '$rhClientAnchor'.EOL;
                     switch ($rhClientAnchor['recLen']) {
                         case 0x8:
                             // echo '$rhClientAnchor:0x000000008'.EOL;
                             $arrClientAnchor['top'] = (int) self::getInt2d($this->streamPowerpointDocument, $pos) / 6;
                             $arrClientAnchor['left'] = (int) self::getInt2d($this->streamPowerpointDocument, $pos + 2) / 6;
                             $arrClientAnchor['width'] = (int) self::getInt2d($this->streamPowerpointDocument, $pos + 4) / 6 - $arrClientAnchor['left'];
                             $arrClientAnchor['height'] = (int) self::getInt2d($this->streamPowerpointDocument, $pos + 6) / 6 - $arrClientAnchor['left'];
                             // print_r($arrClientAnchor);
                             $pos += 8;
                             break;
                         case 0x10:
                             // echo '@$rhClientAnchor:0x00000010'.EOL;
                             break;
                     }
                 } else {
                     $pos -= 8;
                     $rHeader['recLen'] += 8;
                 }
                 //@link : http://msdn.microsoft.com/en-us/library/dd950927(v=office.12).aspx
                 $clientData = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 $pos += 8;
                 $rHeader['recLen'] -= 8;
                 if ($clientData['recVer'] == 0xf && $clientData['recInstance'] == 0x0 && $clientData['recType'] == 0xf011) {
                     // echo '@$clientData'.EOL;
                 } else {
                     $pos -= 8;
                     $rHeader['recLen'] += 8;
                 }
                 //@link : http://msdn.microsoft.com/en-us/library/dd910958(v=office.12).aspx
                 $clientTextbox = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 $pos += 8;
                 $rHeader['recLen'] -= 8;
                 if ($clientTextbox['recVer'] == 0xf && $clientTextbox['recInstance'] == 0x0 && $clientTextbox['recType'] == 0xf00d) {
                     // echo '@$clientTextbox'.EOL;
                     $strLen = 0;
                     do {
                         $rhRgChildRec = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                         $pos += 8;
                         $rHeader['recLen'] -= 8;
                         $clientTextbox['recLen'] -= 8;
                         switch ($rhRgChildRec['recType']) {
                             case self::RT_INTERACTIVEINFO:
                                 // echo '$clientTextbox:RT_InteractiveInfo'.EOL;
                                 //@link : http://msdn.microsoft.com/en-us/library/dd948623(v=office.12).aspx
                                 if ($rhRgChildRec['recInstance'] == 0x0) {
                                     //@link : http://msdn.microsoft.com/en-us/library/dd952348(v=office.12).aspx
                                     $rhInteractiveAtom = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                                     $pos += 8;
                                     $rHeader['recLen'] -= 8;
                                     $clientTextbox['recLen'] -= 8;
                                     if ($rhInteractiveAtom['recVer'] != 0x0 || $rhInteractiveAtom['recInstance'] != 0x0 || $rhInteractiveAtom['recType'] != self::RT_INTERACTIVEINFOATOM || $rhInteractiveAtom['recLen'] != 0x10) {
                                         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > drawing > OfficeArtDg > groupShape > rgfb > shapePrimaryOptions > clientTextbox).');
                                     }
                                     // soundIdRef
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     // exHyperlinkIdRef
                                     $exHyperlinkIdRef = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     // action
                                     $pos += 1;
                                     $rHeader['recLen'] -= 1;
                                     $clientTextbox['recLen'] -= 1;
                                     // oleVerb
                                     $pos += 1;
                                     $rHeader['recLen'] -= 1;
                                     $clientTextbox['recLen'] -= 1;
                                     // jump
                                     $pos += 1;
                                     $rHeader['recLen'] -= 1;
                                     $clientTextbox['recLen'] -= 1;
                                     // fAnimated (1 bit)
                                     // fStopSound (1 bit)
                                     // fCustomShowReturn (1 bit)
                                     // fVisited (1 bit)
                                     // reserved (4 bits)
                                     $pos += 1;
                                     $rHeader['recLen'] -= 1;
                                     $clientTextbox['recLen'] -= 1;
                                     // hyperlinkType
                                     $pos += 1;
                                     $rHeader['recLen'] -= 1;
                                     $clientTextbox['recLen'] -= 1;
                                     // unused
                                     $pos += 3;
                                     $rHeader['recLen'] -= 3;
                                     $clientTextbox['recLen'] -= 3;
                                     // Shape
                                     $arrClientTextBox['hyperlink'][]['id'] = $exHyperlinkIdRef;
                                 }
                                 if ($rhRgChildRec['recInstance'] == 0x1) {
                                     // echo '@todo l.'.__LINE__;
                                 }
                                 break;
                             case self::RT_STYLETEXTPROPATOM:
                                 // echo '$clientTextbox:RT_StyleTextPropAtom'.EOL;
                                 // @link : http://msdn.microsoft.com/en-us/library/dd950647(v=office.12).aspx
                                 $strLenRT = $strLen + 1;
                                 do {
                                     // rgTextPFRun
                                     $countRgTextPFRun = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $strLenRT -= $countRgTextPFRun;
                                     $arrClientTextBox['numTexts']++;
                                     $arrClientTextBox['text' . $arrClientTextBox['numTexts']] = array();
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     // indent
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                     $masks = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     $masksData = array();
                                     $masksData['hasBullet'] = $masks >> 0 & bindec('1');
                                     $masksData['bulletHasFont'] = $masks >> 1 & bindec('1');
                                     $masksData['bulletHasColor'] = $masks >> 2 & bindec('1');
                                     $masksData['bulletHasSize'] = $masks >> 3 & bindec('1');
                                     $masksData['bulletFont'] = $masks >> 4 & bindec('1');
                                     $masksData['bulletColor'] = $masks >> 5 & bindec('1');
                                     $masksData['bulletSize'] = $masks >> 6 & bindec('1');
                                     $masksData['bulletChar'] = $masks >> 7 & bindec('1');
                                     $masksData['leftMargin'] = $masks >> 8 & bindec('1');
                                     $masksData['unused'] = $masks >> 9 & bindec('1');
                                     $masksData['indent'] = $masks >> 10 & bindec('1');
                                     $masksData['align'] = $masks >> 11 & bindec('1');
                                     $masksData['lineSpacing'] = $masks >> 12 & bindec('1');
                                     $masksData['spaceBefore'] = $masks >> 13 & bindec('1');
                                     $masksData['spaceAfter'] = $masks >> 14 & bindec('1');
                                     $masksData['defaultTabSize'] = $masks >> 15 & bindec('1');
                                     $masksData['fontAlign'] = $masks >> 16 & bindec('1');
                                     $masksData['charWrap'] = $masks >> 17 & bindec('1');
                                     $masksData['wordWrap'] = $masks >> 18 & bindec('1');
                                     $masksData['overflow'] = $masks >> 19 & bindec('1');
                                     $masksData['tabStops'] = $masks >> 20 & bindec('1');
                                     $masksData['textDirection'] = $masks >> 21 & bindec('1');
                                     $masksData['reserved1'] = $masks >> 22 & bindec('1');
                                     $masksData['bulletBlip'] = $masks >> 23 & bindec('1');
                                     $masksData['bulletScheme'] = $masks >> 24 & bindec('1');
                                     $masksData['bulletHasScheme'] = $masks >> 25 & bindec('1');
                                     $bulletFlags = array();
                                     if ($masksData['hasBullet'] == 1 || $masksData['bulletHasFont'] == 1 || $masksData['bulletHasColor'] == 1 || $masksData['bulletHasSize '] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $bulletFlags['fHasBullet'] = $data >> 0 & bindec('1');
                                         $bulletFlags['fBulletHasFont'] = $data >> 1 & bindec('1');
                                         $bulletFlags['fBulletHasColor'] = $data >> 2 & bindec('1');
                                         $bulletFlags['fBulletHasSize'] = $data >> 3 & bindec('1');
                                     }
                                     if ($masksData['bulletChar'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $arrClientTextBox['text' . $arrClientTextBox['numTexts']]['bulletChar'] = chr($data);
                                     }
                                     if ($masksData['bulletFont'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['bulletSize'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['bulletColor'] == 1) {
                                         $red = self::getInt1d($this->streamPowerpointDocument, $pos);
                                         $pos += 1;
                                         $rHeader['recLen'] -= 1;
                                         $clientTextbox['recLen'] -= 1;
                                         $green = self::getInt1d($this->streamPowerpointDocument, $pos);
                                         $pos += 1;
                                         $rHeader['recLen'] -= 1;
                                         $clientTextbox['recLen'] -= 1;
                                         $blue = self::getInt1d($this->streamPowerpointDocument, $pos);
                                         $pos += 1;
                                         $rHeader['recLen'] -= 1;
                                         $clientTextbox['recLen'] -= 1;
                                         $index = self::getInt1d($this->streamPowerpointDocument, $pos);
                                         $pos += 1;
                                         $rHeader['recLen'] -= 1;
                                         $clientTextbox['recLen'] -= 1;
                                         if ($index == 0xfe) {
                                             $strColor = str_pad(dechex($red), 2, STR_PAD_LEFT, '0');
                                             $strColor .= str_pad(dechex($green), 2, STR_PAD_LEFT, '0');
                                             $strColor .= str_pad(dechex($blue), 2, STR_PAD_LEFT, '0');
                                         }
                                     }
                                     if ($masksData['align'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         switch ($data) {
                                             case 0x0:
                                                 $arrClientTextBox['alignH'] = Alignment::HORIZONTAL_LEFT;
                                                 break;
                                             case 0x1:
                                                 $arrClientTextBox['alignH'] = Alignment::HORIZONTAL_CENTER;
                                                 break;
                                             case 0x2:
                                                 $arrClientTextBox['alignH'] = Alignment::HORIZONTAL_RIGHT;
                                                 break;
                                             case 0x3:
                                                 $arrClientTextBox['alignH'] = Alignment::HORIZONTAL_JUSTIFY;
                                                 break;
                                             case 0x4:
                                                 $arrClientTextBox['alignH'] = Alignment::HORIZONTAL_DISTRIBUTED;
                                                 break;
                                             case 0x5:
                                                 $arrClientTextBox['alignH'] = Alignment::HORIZONTAL_DISTRIBUTED;
                                                 break;
                                             case 0x6:
                                                 $arrClientTextBox['alignH'] = Alignment::HORIZONTAL_JUSTIFY;
                                                 break;
                                             default:
                                                 break;
                                         }
                                     }
                                     if ($masksData['lineSpacing'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['spaceBefore'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['spaceAfter'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['leftMargin'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $arrClientTextBox['text' . $arrClientTextBox['numTexts']]['leftMargin'] = (int) round($data / 6);
                                     }
                                     if ($masksData['indent'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $arrClientTextBox['text' . $arrClientTextBox['numTexts']]['indent'] = (int) round($data / 6);
                                     }
                                     if ($masksData['defaultTabSize'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['tabStops'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                     if ($masksData['fontAlign'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['charWrap'] == 1 || $masksData['wordWrap'] == 1 || $masksData['overflow'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['textDirection'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                 } while ($strLenRT > 0);
                                 $strLenRT = $strLen + 1;
                                 do {
                                     // rgTextCFRun
                                     $countRgTextCFRun = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $strLenRT -= $countRgTextCFRun;
                                     $arrClientTextBox['numParts']++;
                                     $arrClientTextBox['part' . $arrClientTextBox['numParts']] = array();
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     $arrClientTextBox['part' . $arrClientTextBox['numParts']]['length'] = $countRgTextCFRun;
                                     $masks = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     $masksData = array();
                                     $masksData['bold'] = $masks >> 0 & bindec('1');
                                     $masksData['italic'] = $masks >> 1 & bindec('1');
                                     $masksData['underline'] = $masks >> 2 & bindec('1');
                                     $masksData['unused1'] = $masks >> 3 & bindec('1');
                                     $masksData['shadow'] = $masks >> 4 & bindec('1');
                                     $masksData['fehint'] = $masks >> 5 & bindec('1');
                                     $masksData['unused2'] = $masks >> 6 & bindec('1');
                                     $masksData['kumi'] = $masks >> 7 & bindec('1');
                                     $masksData['unused3'] = $masks >> 8 & bindec('1');
                                     $masksData['emboss'] = $masks >> 9 & bindec('1');
                                     $masksData['fHasStyle'] = $masks >> 10 & bindec('1111');
                                     $masksData['unused4'] = $masks >> 14 & bindec('11');
                                     $masksData['typeface'] = $masks >> 16 & bindec('1');
                                     $masksData['size'] = $masks >> 17 & bindec('1');
                                     $masksData['color'] = $masks >> 18 & bindec('1');
                                     $masksData['position'] = $masks >> 19 & bindec('1');
                                     $masksData['pp10ext'] = $masks >> 20 & bindec('1');
                                     $masksData['oldEATypeface'] = $masks >> 21 & bindec('1');
                                     $masksData['ansiTypeface'] = $masks >> 22 & bindec('1');
                                     $masksData['symbolTypeface'] = $masks >> 23 & bindec('1');
                                     $masksData['newEATypeface'] = $masks >> 24 & bindec('1');
                                     $masksData['csTypeface'] = $masks >> 25 & bindec('1');
                                     $masksData['pp11ext'] = $masks >> 26 & bindec('1');
                                     if ($masksData['bold'] == 1 || $masksData['italic'] == 1 || $masksData['underline'] == 1 || $masksData['shadow'] == 1 || $masksData['fehint'] == 1 || $masksData['kumi'] == 1 || $masksData['emboss'] == 1 || $masksData['fHasStyle'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $fontStyleFlags['bold'] = $data >> 0 & bindec('1');
                                         $fontStyleFlags['italic'] = $data >> 1 & bindec('1');
                                         $fontStyleFlags['underline'] = $data >> 2 & bindec('1');
                                         $fontStyleFlags['unused1'] = $data >> 3 & bindec('1');
                                         $fontStyleFlags['shadow'] = $data >> 4 & bindec('1');
                                         $fontStyleFlags['fehint'] = $data >> 5 & bindec('1');
                                         $fontStyleFlags['unused2'] = $data >> 6 & bindec('1');
                                         $fontStyleFlags['kumi'] = $data >> 7 & bindec('1');
                                         $fontStyleFlags['unused3'] = $data >> 8 & bindec('1');
                                         $fontStyleFlags['emboss'] = $data >> 9 & bindec('1');
                                         $fontStyleFlags['pp9rt'] = $data >> 10 & bindec('1111');
                                         $fontStyleFlags['unused4'] = $data >> 14 & bindec('11');
                                         $arrClientTextBox['part' . $arrClientTextBox['numParts']]['bold'] = $fontStyleFlags['bold'] == 1 ? true : false;
                                         $arrClientTextBox['part' . $arrClientTextBox['numParts']]['italic'] = $fontStyleFlags['italic'] == 1 ? true : false;
                                         $arrClientTextBox['part' . $arrClientTextBox['numParts']]['underline'] = $fontStyleFlags['underline'] == 1 ? true : false;
                                     }
                                     if ($masksData['typeface'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $arrClientTextBox['part' . $arrClientTextBox['numParts']]['fontName'] = isset($this->arrayFonts[$data]) ? $this->arrayFonts[$data] : '';
                                     }
                                     if ($masksData['oldEATypeface'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                     if ($masksData['ansiTypeface'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                     if ($masksData['symbolTypeface'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                     if ($masksData['size'] == 1) {
                                         $arrClientTextBox['part' . $arrClientTextBox['numParts']]['fontSize'] = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['color'] == 1) {
                                         $red = self::getInt1d($this->streamPowerpointDocument, $pos);
                                         $pos += 1;
                                         $rHeader['recLen'] -= 1;
                                         $clientTextbox['recLen'] -= 1;
                                         $green = self::getInt1d($this->streamPowerpointDocument, $pos);
                                         $pos += 1;
                                         $rHeader['recLen'] -= 1;
                                         $clientTextbox['recLen'] -= 1;
                                         $blue = self::getInt1d($this->streamPowerpointDocument, $pos);
                                         $pos += 1;
                                         $rHeader['recLen'] -= 1;
                                         $clientTextbox['recLen'] -= 1;
                                         $index = self::getInt1d($this->streamPowerpointDocument, $pos);
                                         $pos += 1;
                                         $rHeader['recLen'] -= 1;
                                         $clientTextbox['recLen'] -= 1;
                                         if ($index == 0xfe) {
                                             $strColor = str_pad(dechex($red), 2, STR_PAD_LEFT, '0');
                                             $strColor .= str_pad(dechex($green), 2, STR_PAD_LEFT, '0');
                                             $strColor .= str_pad(dechex($blue), 2, STR_PAD_LEFT, '0');
                                             $arrClientTextBox['part' . $arrClientTextBox['numParts']]['color'] = new Color('FF' . $strColor);
                                         }
                                     }
                                     if ($masksData['position'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                 } while ($strLenRT > 0);
                                 break;
                             case self::RT_TEXTCHARSATOM:
                                 // echo '$clientTextbox:RT_TextCharsAtom'.EOL;
                                 // @link : http://msdn.microsoft.com/en-us/library/dd772921(v=office.12).aspx
                                 $strLen = (int) ($rhRgChildRec['recLen'] / 2);
                                 for ($inc = 0; $inc < $rhRgChildRec['recLen'] / 2; $inc++) {
                                     $char = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     if ($char == 0xb) {
                                         $char = 0x20;
                                     }
                                     $arrClientTextBox['text'] .= chr($char);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 // echo $arrClientTextBox['text'].EOL;
                                 break;
                             case self::RT_TEXTHEADERATOM:
                                 // echo '$clientTextbox:RT_TextHeaderAtom'.EOL;
                                 // @link : http://msdn.microsoft.com/en-us/library/dd905272(v=office.12).aspx
                                 // textType
                                 $pos += 4;
                                 $rHeader['recLen'] -= 4;
                                 $clientTextbox['recLen'] -= 4;
                                 break;
                             case self::RT_TEXTINTERACTIVEINFOATOM:
                                 // echo '$clientTextbox:RT_TextInteractiveInfoAtom'.EOL;
                                 //@link : http://msdn.microsoft.com/en-us/library/dd947973(v=office.12).aspx
                                 if ($rhRgChildRec['recInstance'] == 0x0) {
                                     //@link : http://msdn.microsoft.com/en-us/library/dd944072(v=office.12).aspx
                                     $arrClientTextBox['hyperlink'][count($arrClientTextBox['hyperlink']) - 1]['start'] = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     $arrClientTextBox['hyperlink'][count($arrClientTextBox['hyperlink']) - 1]['end'] = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                 }
                                 if ($rhRgChildRec['recInstance'] == 0x1) {
                                     // echo '@todo l.'.__LINE__;
                                 }
                                 break;
                             case self::RT_TEXTSPECIALINFOATOM:
                                 // echo '$clientTextbox:RT_TextSpecialInfoAtom'.EOL;
                                 // @link : http://msdn.microsoft.com/en-us/library/dd945296(v=office.12).aspx
                                 $strLenRT = $strLen + 1;
                                 do {
                                     $count = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     $strLenRT -= $count;
                                     $data = self::getInt4d($this->streamPowerpointDocument, $pos);
                                     $pos += 4;
                                     $rHeader['recLen'] -= 4;
                                     $clientTextbox['recLen'] -= 4;
                                     $masksData = array();
                                     $masksData['spell'] = $data >> 0 & bindec('1');
                                     $masksData['lang'] = $data >> 1 & bindec('1');
                                     $masksData['altLang'] = $data >> 2 & bindec('1');
                                     $masksData['unused1'] = $data >> 3 & bindec('1');
                                     $masksData['unused2'] = $data >> 4 & bindec('1');
                                     $masksData['fPp10ext'] = $data >> 5 & bindec('1');
                                     $masksData['fBidi'] = $data >> 6 & bindec('1');
                                     $masksData['unused3'] = $data >> 7 & bindec('1');
                                     $masksData['reserved1'] = $data >> 8 & bindec('1');
                                     $masksData['smartTag'] = $data >> 9 & bindec('1');
                                     if ($masksData['spell'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $masksSpell = array();
                                         $masksSpell['error'] = $data >> 0 & bindec('1');
                                         $masksSpell['clean'] = $data >> 1 & bindec('1');
                                         $masksSpell['grammar'] = $data >> 2 & bindec('1');
                                     }
                                     if ($masksData['lang'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['altLang'] == 1) {
                                         $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                     }
                                     if ($masksData['fBidi'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                     if ($masksData['fPp10ext'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                     if ($masksData['smartTag'] == 1) {
                                         // echo '@todo l.'.__LINE__;
                                     }
                                 } while ($strLenRT > 0);
                                 break;
                             case self::RT_TEXTRULERATOM:
                                 // echo '$clientTextbox:RT_TextRulerAtom'.EOL;
                                 // @link : http://msdn.microsoft.com/en-us/library/dd953212(v=office.12).aspx
                                 $data = self::getInt4d($this->streamPowerpointDocument, $pos);
                                 $pos += 4;
                                 $rHeader['recLen'] -= 4;
                                 $clientTextbox['recLen'] -= 4;
                                 $masksData = array();
                                 $masksData['fDefaultTabSize'] = $data >> 0 & bindec('1');
                                 $masksData['fCLevels'] = $data >> 1 & bindec('1');
                                 $masksData['fTabStops'] = $data >> 2 & bindec('1');
                                 $masksData['fLeftMargin1'] = $data >> 3 & bindec('1');
                                 $masksData['fLeftMargin2'] = $data >> 4 & bindec('1');
                                 $masksData['fLeftMargin3'] = $data >> 5 & bindec('1');
                                 $masksData['fLeftMargin4'] = $data >> 6 & bindec('1');
                                 $masksData['fLeftMargin5'] = $data >> 7 & bindec('1');
                                 $masksData['fIndent1'] = $data >> 8 & bindec('1');
                                 $masksData['fIndent2'] = $data >> 9 & bindec('1');
                                 $masksData['fIndent3'] = $data >> 10 & bindec('1');
                                 $masksData['fIndent4'] = $data >> 11 & bindec('1');
                                 $masksData['fIndent5'] = $data >> 12 & bindec('1');
                                 if ($masksData['fCLevels'] == 1) {
                                     // echo '@todo l.'.__LINE__;
                                 }
                                 if ($masksData['fDefaultTabSize'] == 1) {
                                     // echo '@todo l.'.__LINE__;
                                 }
                                 if ($masksData['fTabStops'] == 1) {
                                     $count = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                     $arrayTabStops = array();
                                     for ($inc = 0; $inc < $count; $inc++) {
                                         $position = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $type = self::getInt2d($this->streamPowerpointDocument, $pos);
                                         $pos += 2;
                                         $rHeader['recLen'] -= 2;
                                         $clientTextbox['recLen'] -= 2;
                                         $arrayTabStops[] = array('position' => $position, 'type' => $type);
                                     }
                                 }
                                 if ($masksData['fLeftMargin1'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fIndent1'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fLeftMargin2'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fIndent2'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fLeftMargin3'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fIndent3'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fLeftMargin4'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fIndent4'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fLeftMargin5'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 if ($masksData['fIndent5'] == 1) {
                                     $data = self::getInt2d($this->streamPowerpointDocument, $pos);
                                     $pos += 2;
                                     $rHeader['recLen'] -= 2;
                                     $clientTextbox['recLen'] -= 2;
                                 }
                                 break;
                             default:
                                 // echo EOL;
                                 // print_r($rhRgChildRec);
                                 // echo EOL;
                                 // echo '@$type : '.dechex($rhRgChildRec['recType']).EOL;
                         }
                     } while ($clientTextbox['recLen'] > 0);
                 } else {
                     $pos -= 8;
                     $rHeader['recLen'] += 8;
                 }
                 $shpSecondaryOptions2 = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 $pos += 8;
                 $rHeader['recLen'] -= 8;
                 if ($bShpSecondaryOpt1 == true && $shpSecondaryOptions2['recVer'] == 0x3 && $shpSecondaryOptions2['recType'] == 0xf121) {
                 } else {
                     $pos -= 8;
                     $rHeader['recLen'] += 8;
                 }
                 $shpTertiaryOptions2 = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
                 $pos += 8;
                 $rHeader['recLen'] -= 8;
                 if ($bShpTertiaryOptions1 == true && $shpTertiaryOptions2['recVer'] == 0x3 && $shpTertiaryOptions2['recType'] == 0xf122) {
                 } else {
                     $pos -= 8;
                     $rHeader['recLen'] += 8;
                 }
                 break;
         }
         // Cleaning variables
         if (empty($arrClientTextBox['hyperlink'])) {
             unset($arrClientTextBox['hyperlink']);
         }
         if (empty($arrClientTextBox['text'])) {
             unset($arrClientTextBox['text']);
         }
         if (empty($arrClientTextBox['numParts'])) {
             unset($arrClientTextBox['numParts']);
         }
         if (empty($arrClientTextBox['numTexts'])) {
             unset($arrClientTextBox['numTexts']);
         }
         // echo EOL;
         if (isset($arrShpPrimaryOpt['pib']) && isset($this->arrayPictures[$arrShpPrimaryOpt['pib'] - 1])) {
             // echo '//IMAGE'.EOL;
             $gdImage = imagecreatefromstring($this->arrayPictures[$arrShpPrimaryOpt['pib'] - 1]);
             $shape = new MemoryDrawing();
             $shape->setImageResource($gdImage);
             if (isset($arrShpPrimaryOpt['shadowOffsetX']) && $arrShpPrimaryOpt['shadowOffsetX'] != 0 && isset($arrShpPrimaryOpt['shadowOffsetY']) && $arrShpPrimaryOpt['shadowOffsetY'] != 0) {
                 $shape->getShadow()->setVisible(true);
                 if ($arrShpPrimaryOpt['shadowOffsetX'] > 0 && $arrShpPrimaryOpt['shadowOffsetX'] == $arrShpPrimaryOpt['shadowOffsetY']) {
                     $shape->getShadow()->setDistance($arrShpPrimaryOpt['shadowOffsetX'])->setDirection(45);
                 }
             }
             if (!is_null($shape) && !empty($arrClientAnchor)) {
                 $shape->setOffsetX($arrClientAnchor['left']);
                 $shape->setOffsetY($arrClientAnchor['top']);
                 $shape->setWidth($arrClientAnchor['width']);
                 $shape->setHeight($arrClientAnchor['height']);
             }
         }
         if (!empty($arrClientTextBox) && isset($arrClientTextBox)) {
             // echo '//TEXT'.EOL;
             // echo '<pre>';
             // print_r($arrClientTextBox);
             // echo '</pre>';
             $shape = new RichText();
             if (isset($arrClientTextBox['alignH'])) {
                 $shape->getActiveParagraph()->getAlignment()->setHorizontal($arrClientTextBox['alignH']);
             }
             $start = 0;
             // echo $arrClientTextBox['text'].EOL;
             $lastLevel = -1;
             $lastMarginLeft = 0;
             for ($inc = 1; $inc <= $arrClientTextBox['numParts']; $inc++) {
                 if ($arrClientTextBox['numParts'] == $arrClientTextBox['numTexts'] && isset($arrClientTextBox['text' . $inc])) {
                     if (isset($arrClientTextBox['text' . $inc]['bulletChar'])) {
                         $shape->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET);
                         $shape->getActiveParagraph()->getBulletStyle()->setBulletChar($arrClientTextBox['text' . $inc]['bulletChar']);
                     }
                     // Indent
                     $indent = 0;
                     if (isset($arrClientTextBox['text' . $inc]['indent'])) {
                         $indent = $arrClientTextBox['text' . $inc]['indent'];
                     }
                     if (isset($arrClientTextBox['text' . $inc]['leftMargin'])) {
                         if ($lastMarginLeft > $arrClientTextBox['text' . $inc]['leftMargin']) {
                             $lastLevel--;
                         }
                         if ($lastMarginLeft < $arrClientTextBox['text' . $inc]['leftMargin']) {
                             $lastLevel++;
                         }
                         $shape->getActiveParagraph()->getAlignment()->setLevel($lastLevel);
                         $lastMarginLeft = $arrClientTextBox['text' . $inc]['leftMargin'];
                         $shape->getActiveParagraph()->getAlignment()->setMarginLeft($arrClientTextBox['text' . $inc]['leftMargin']);
                         $shape->getActiveParagraph()->getAlignment()->setIndent($indent - $arrClientTextBox['text' . $inc]['leftMargin']);
                     }
                 }
                 // Texte
                 $sText = substr($arrClientTextBox['text'], $start, $arrClientTextBox['part' . $inc]['length']);
                 $sHyperlinkURL = '';
                 if (empty($sText)) {
                     // Is there a hyperlink ?
                     if (!empty($arrClientTextBox['hyperlink'])) {
                         foreach ($arrClientTextBox['hyperlink'] as $itmHyperlink) {
                             if ($itmHyperlink['start'] == $start && $itmHyperlink['end'] - $itmHyperlink['start'] == $arrClientTextBox['part' . $inc]['length']) {
                                 $sText = $this->arrayHyperlinks[$itmHyperlink['id']]['text'];
                                 $sHyperlinkURL = $this->arrayHyperlinks[$itmHyperlink['id']]['url'];
                                 break;
                             }
                         }
                     }
                 }
                 // New paragraph
                 $bCreateParagraph = false;
                 if (strpos($sText, "\r") != false) {
                     $bCreateParagraph = true;
                     $sText = str_replace("\r", '', $sText);
                 }
                 // TextRun
                 $txtRun = $shape->createTextRun($sText);
                 if (isset($arrClientTextBox['part' . $inc]['bold'])) {
                     $txtRun->getFont()->setBold($arrClientTextBox['part' . $inc]['bold']);
                 }
                 if (isset($arrClientTextBox['part' . $inc]['italic'])) {
                     $txtRun->getFont()->setItalic($arrClientTextBox['part' . $inc]['italic']);
                 }
                 if (isset($arrClientTextBox['part' . $inc]['underline'])) {
                     $txtRun->getFont()->setUnderline($arrClientTextBox['part' . $inc]['underline']);
                 }
                 if (isset($arrClientTextBox['part' . $inc]['fontName'])) {
                     $txtRun->getFont()->setName($arrClientTextBox['part' . $inc]['fontName']);
                 }
                 if (isset($arrClientTextBox['part' . $inc]['fontSize'])) {
                     $txtRun->getFont()->setSize($arrClientTextBox['part' . $inc]['fontSize']);
                 }
                 if (isset($arrClientTextBox['part' . $inc]['color'])) {
                     $txtRun->getFont()->setColor($arrClientTextBox['part' . $inc]['color']);
                 }
                 // Hyperlink
                 if (!empty($sHyperlinkURL)) {
                     $txtRun->setHyperlink(new Hyperlink($sHyperlinkURL));
                 }
                 $start += $arrClientTextBox['part' . $inc]['length'];
                 if ($bCreateParagraph) {
                     $shape->createParagraph();
                 }
             }
             if (!is_null($shape) && !empty($arrClientAnchor)) {
                 $shape->setOffsetX($arrClientAnchor['left']);
                 $shape->setOffsetY($arrClientAnchor['top']);
                 $shape->setWidth($arrClientAnchor['width']);
                 $shape->setHeight($arrClientAnchor['height']);
             }
         }
         if (isset($arrShpPrimaryOpt['line']) && $arrShpPrimaryOpt['line'] == true) {
             // echo '//LINE'.EOL;
             $shape = new Line(0, 0, 0, 0);
             if (isset($arrShpPrimaryOpt['lineColor'])) {
                 $shape->getBorder()->getColor()->setARGB('FF' . $arrShpPrimaryOpt['lineColor']);
             }
             if (!empty($arrClientAnchor)) {
                 $shape->setOffsetX($arrClientAnchor['left']);
                 $shape->setOffsetY($arrClientAnchor['top']);
                 $shape->setWidth($arrClientAnchor['width']);
                 $shape->setHeight($arrShpPrimaryOpt['lineWidth']);
             }
         }
         if (isset($arrShpPrimaryOpt['insetBottom'])) {
             $shape->setInsetBottom($arrShpPrimaryOpt['insetBottom']);
         }
         if (isset($arrShpPrimaryOpt['insetLeft'])) {
             $shape->setInsetLeft($arrShpPrimaryOpt['insetLeft']);
         }
         if (isset($arrShpPrimaryOpt['insetRight'])) {
             $shape->setInsetRight($arrShpPrimaryOpt['insetRight']);
         }
         if (isset($arrShpPrimaryOpt['insetTop'])) {
             $shape->setInsetTop($arrShpPrimaryOpt['insetTop']);
         }
         if (!is_null($shape) && $shape instanceof AbstractShape) {
             // echo '//SHAPE'.EOL;
             $oSlide->addShape($shape);
         }
         // echo '//END.....'.EOL.EOL.EOL;
     } while ($rHeader['recLen'] > 0);
     // *** slideSchemeColorSchemeAtom (40 bytes)
     // slideSchemeColorSchemeAtom > rh
     $rHeader = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
     $pos += 8;
     if ($rHeader['recVer'] != 0x0 || $rHeader['recInstance'] != 0x1 || $rHeader['recType'] != self::RT_COLORSCHEMEATOM || $rHeader['recLen'] != 0x20) {
         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > slideSchemeColorSchemeAtom > rh).');
     }
     // slideSchemeColorSchemeAtom > rgSchemeColor
     $rgSchemeColor = array();
     for ($inc = 0; $inc <= 7; $inc++) {
         $rgSchemeColor[] = array('red' => self::getInt1d($this->streamPowerpointDocument, $pos + $inc * 4), 'green' => self::getInt1d($this->streamPowerpointDocument, $pos + $inc * 4 + 1), 'blue' => self::getInt1d($this->streamPowerpointDocument, $pos + $inc * 4 + 2));
     }
     $pos += 8 * 4;
     // *** slideNameAtom (variable)
     // *** slideProgTagsContainer (variable).
     // slideProgTagsContainer > rh
     $rHeader = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
     $pos += 8;
     if ($rHeader['recVer'] != 0xf || $rHeader['recInstance'] != 0x0 || $rHeader['recType'] != self::RT_PROGTAGS) {
         throw new \Exception('File PowerPoint 97 in error (Location : RTSlide > slideProgTagsContainer > rh).');
     }
 }
Ejemplo n.º 9
0
 public function testLine()
 {
     $valEmu10 = Drawing::pixelsToEmu(10);
     $valEmu90 = Drawing::pixelsToEmu(90);
     $phpPowerPoint = new PhpPowerpoint();
     $oSlide = $phpPowerPoint->getActiveSlide();
     $oSlide->createLineShape(10, 10, 100, 100);
     $oSlide->createLineShape(100, 10, 10, 100);
     $oSlide->createLineShape(10, 100, 100, 10);
     $oSlide->createLineShape(100, 100, 10, 10);
     $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007');
     $element = '/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom';
     $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml'));
     $this->assertEquals('line', $pres->getElementAttribute($element, 'prst', 'ppt/slides/slide1.xml'));
     $element = '/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:xfrm/a:ext[@cx="' . $valEmu90 . '"][@cy="' . $valEmu90 . '"]';
     $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml'));
     $element = '/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:xfrm/a:off[@x="' . $valEmu10 . '"][@y="' . $valEmu10 . '"]';
     $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml'));
     $element = '/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:xfrm[@flipV="1"]/a:off[@x="' . $valEmu10 . '"][@y="' . $valEmu10 . '"]';
     $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml'));
 }