/**
  * Write Override content type
  *
  * @param 	Shared_XMLWriter 	$objWriter 		XML Writer
  * @param 	string 						$pPartname 		Part name
  * @param 	string 						$pContentType 	Content type
  * @throws 	Exception
  */
 private function _writeOverrideContentType(Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
 {
     if ($pPartname != '' && $pContentType != '') {
         // Write content type
         $objWriter->startElement('Override');
         $objWriter->writeAttribute('PartName', $pPartname);
         $objWriter->writeAttribute('ContentType', $pContentType);
         $objWriter->endElement();
     } else {
         throw new Exception("Invalid parameters passed.");
     }
 }
Beispiel #2
0
 /**
  * Write VML comment to XML format
  *
  * @param 	Shared_XMLWriter		$objWriter 			XML Writer
  * @param	string							$pCellReference		Cell reference
  * @param 	Comment				$pComment			Comment
  * @throws 	Exception
  */
 public function _writeVMLComment(Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', Comment $pComment = null)
 {
     // Metadata
     list($column, $row) = Cell::coordinateFromString($pCellReference);
     $column = Cell::columnIndexFromString($column);
     $id = 1024 + $column + $row;
     $id = substr($id, 0, 4);
     // v:shape
     $objWriter->startElement('v:shape');
     $objWriter->writeAttribute('id', '_x0000_s' . $id);
     $objWriter->writeAttribute('type', '#_x0000_t202');
     $objWriter->writeAttribute('style', 'position:absolute;margin-left:' . $pComment->getMarginLeft() . ';margin-top:' . $pComment->getMarginTop() . ';width:' . $pComment->getWidth() . ';height:' . $pComment->getHeight() . ';z-index:1;visibility:' . ($pComment->getVisible() ? 'visible' : 'hidden'));
     $objWriter->writeAttribute('fillcolor', '#' . $pComment->getFillColor()->getRGB());
     $objWriter->writeAttribute('o:insetmode', 'auto');
     // v:fill
     $objWriter->startElement('v:fill');
     $objWriter->writeAttribute('color2', '#' . $pComment->getFillColor()->getRGB());
     $objWriter->endElement();
     // v:shadow
     $objWriter->startElement('v:shadow');
     $objWriter->writeAttribute('on', 't');
     $objWriter->writeAttribute('color', 'black');
     $objWriter->writeAttribute('obscured', 't');
     $objWriter->endElement();
     // v:path
     $objWriter->startElement('v:path');
     $objWriter->writeAttribute('o:connecttype', 'none');
     $objWriter->endElement();
     // v:textbox
     $objWriter->startElement('v:textbox');
     $objWriter->writeAttribute('style', 'mso-direction-alt:auto');
     // div
     $objWriter->startElement('div');
     $objWriter->writeAttribute('style', 'text-align:left');
     $objWriter->endElement();
     $objWriter->endElement();
     // x:ClientData
     $objWriter->startElement('x:ClientData');
     $objWriter->writeAttribute('ObjectType', 'Note');
     // x:MoveWithCells
     $objWriter->writeElement('x:MoveWithCells', '');
     // x:SizeWithCells
     $objWriter->writeElement('x:SizeWithCells', '');
     // x:Anchor
     //$objWriter->writeElement('x:Anchor', $column . ', 15, ' . ($row - 2) . ', 10, ' . ($column + 4) . ', 15, ' . ($row + 5) . ', 18');
     // x:AutoFill
     $objWriter->writeElement('x:AutoFill', 'False');
     // x:Row
     $objWriter->writeElement('x:Row', $row - 1);
     // x:Column
     $objWriter->writeElement('x:Column', $column - 1);
     $objWriter->endElement();
     $objWriter->endElement();
 }
Beispiel #3
0
 /**
  * Write VML comment to XML format
  *
  * @param 	Shared_XMLWriter		$objWriter 			XML Writer
  * @param	string							$pReference			Reference
  * @param 	Worksheet_HeaderFooterDrawing	$pImage		Image
  * @throws 	Exception
  */
 public function _writeVMLHeaderFooterImage(Shared_XMLWriter $objWriter = null, $pReference = '', Worksheet_HeaderFooterDrawing $pImage = null)
 {
     // Calculate object id
     preg_match('{(\\d+)}', md5($pReference), $m);
     $id = 1500 + substr($m[1], 0, 2) * 1;
     // Calculate offset
     $width = $pImage->getWidth();
     $height = $pImage->getHeight();
     $marginLeft = $pImage->getOffsetX();
     $marginTop = $pImage->getOffsetY();
     // v:shape
     $objWriter->startElement('v:shape');
     $objWriter->writeAttribute('id', $pReference);
     $objWriter->writeAttribute('o:spid', '_x0000_s' . $id);
     $objWriter->writeAttribute('type', '#_x0000_t75');
     $objWriter->writeAttribute('style', "position:absolute;margin-left:{$marginLeft}px;margin-top:{$marginTop}px;width:{$width}px;height:{$height}px;z-index:1");
     // v:imagedata
     $objWriter->startElement('v:imagedata');
     $objWriter->writeAttribute('o:relid', 'rId' . $pReference);
     $objWriter->writeAttribute('o:title', $pImage->getName());
     $objWriter->endElement();
     // o:lock
     $objWriter->startElement('o:lock');
     $objWriter->writeAttribute('v:ext', 'edit');
     $objWriter->writeAttribute('rotation', 't');
     $objWriter->endElement();
     $objWriter->endElement();
 }
Beispiel #4
0
 /**
  * Write Override content type
  *
  * @param 	Shared_XMLWriter 	$objWriter 		XML Writer
  * @param 	int							$pId			Relationship ID. rId will be prepended!
  * @param 	string						$pType			Relationship type
  * @param 	string 						$pTarget		Relationship target
  * @param 	string 						$pTargetMode	Relationship target mode
  * @throws 	Exception
  */
 private function _writeRelationship(Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '')
 {
     if ($pType != '' && $pTarget != '') {
         // Write relationship
         $objWriter->startElement('Relationship');
         $objWriter->writeAttribute('Id', 'rId' . $pId);
         $objWriter->writeAttribute('Type', $pType);
         $objWriter->writeAttribute('Target', $pTarget);
         if ($pTargetMode != '') {
             $objWriter->writeAttribute('TargetMode', $pTargetMode);
         }
         $objWriter->endElement();
     } else {
         throw new Exception("Invalid parameters passed.");
     }
 }
Beispiel #5
0
 /**
  * Write Defined Name for PrintTitles
  *
  * @param 	Shared_XMLWriter	$objWriter 		XML Writer
  * @param 	Worksheet			$pSheet
  * @param 	int							$pSheetId
  * @throws 	Exception
  */
 private function _writeDefinedNameForPrintArea(Shared_XMLWriter $objWriter = null, Worksheet $pSheet = null, $pSheetId = 0)
 {
     // definedName for PrintArea
     if ($pSheet->getPageSetup()->isPrintAreaSet()) {
         $objWriter->startElement('definedName');
         $objWriter->writeAttribute('name', '_xlnm.Print_Area');
         $objWriter->writeAttribute('localSheetId', $pSheetId);
         // Setting string
         $settingString = '';
         // Print area
         $printArea = Cell::splitRange($pSheet->getPageSetup()->getPrintArea());
         $chunks = array();
         foreach ($printArea as $printAreaRect) {
             $printAreaRect[0] = Cell::absoluteCoordinate($printAreaRect[0]);
             $printAreaRect[1] = Cell::absoluteCoordinate($printAreaRect[1]);
             $chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect);
         }
         $objWriter->writeRaw(implode(',', $chunks));
         $objWriter->endElement();
     }
 }
Beispiel #6
0
 /**
  * Write NumberFormat
  *
  * @param 	Shared_XMLWriter			$objWriter 		XML Writer
  * @param 	Style_NumberFormat			$pNumberFormat	Number Format
  * @param 	int									$pId			Number Format identifier
  * @throws 	Exception
  */
 private function _writeNumFmt(Shared_XMLWriter $objWriter = null, Style_NumberFormat $pNumberFormat = null, $pId = 0)
 {
     // Translate formatcode
     $formatCode = $pNumberFormat->getFormatCode();
     // numFmt
     $objWriter->startElement('numFmt');
     $objWriter->writeAttribute('numFmtId', $pId + 164);
     $objWriter->writeAttribute('formatCode', $formatCode);
     $objWriter->endElement();
 }
Beispiel #7
0
 /**
  * Write docProps/core.xml to XML format
  *
  * @param 	PHPExcel	$pPHPExcel
  * @return 	string 		XML Output
  * @throws 	Exception
  */
 public function writeDocPropsCore(PHPExcel $pPHPExcel = null)
 {
     // Create XML writer
     $objWriter = null;
     if ($this->getParentWriter()->getUseDiskCaching()) {
         $objWriter = new Shared_XMLWriter(Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
     } else {
         $objWriter = new Shared_XMLWriter(Shared_XMLWriter::STORAGE_MEMORY);
     }
     // XML header
     $objWriter->startDocument('1.0', 'UTF-8', 'yes');
     // cp:coreProperties
     $objWriter->startElement('cp:coreProperties');
     $objWriter->writeAttribute('xmlns:cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties');
     $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
     $objWriter->writeAttribute('xmlns:dcterms', 'http://purl.org/dc/terms/');
     $objWriter->writeAttribute('xmlns:dcmitype', 'http://purl.org/dc/dcmitype/');
     $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
     // dc:creator
     $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator());
     // cp:lastModifiedBy
     $objWriter->writeElement('cp:lastModifiedBy', $pPHPExcel->getProperties()->getLastModifiedBy());
     // dcterms:created
     $objWriter->startElement('dcterms:created');
     $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF');
     $objWriter->writeRaw(date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
     $objWriter->endElement();
     // dcterms:modified
     $objWriter->startElement('dcterms:modified');
     $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF');
     $objWriter->writeRaw(date(DATE_W3C, $pPHPExcel->getProperties()->getModified()));
     $objWriter->endElement();
     // dc:title
     $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle());
     // dc:description
     $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription());
     // dc:subject
     $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject());
     // cp:keywords
     $objWriter->writeElement('cp:keywords', $pPHPExcel->getProperties()->getKeywords());
     // cp:category
     $objWriter->writeElement('cp:category', $pPHPExcel->getProperties()->getCategory());
     $objWriter->endElement();
     // Return
     return $objWriter->getData();
 }
Beispiel #8
0
 /**
  * Write theme to XML format
  *
  * @param 	PHPExcel	$pPHPExcel
  * @return 	string 		XML Output
  * @throws 	Exception
  */
 public function writeTheme(PHPExcel $pPHPExcel = null)
 {
     // Create XML writer
     $objWriter = null;
     if ($this->getParentWriter()->getUseDiskCaching()) {
         $objWriter = new Shared_XMLWriter(Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
     } else {
         $objWriter = new Shared_XMLWriter(Shared_XMLWriter::STORAGE_MEMORY);
     }
     // XML header
     $objWriter->startDocument('1.0', 'UTF-8', 'yes');
     // a:theme
     $objWriter->startElement('a:theme');
     $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
     $objWriter->writeAttribute('name', 'Office Theme');
     // a:themeElements
     $objWriter->startElement('a:themeElements');
     // a:clrScheme
     $objWriter->startElement('a:clrScheme');
     $objWriter->writeAttribute('name', 'Office');
     // a:dk1
     $objWriter->startElement('a:dk1');
     // a:sysClr
     $objWriter->startElement('a:sysClr');
     $objWriter->writeAttribute('val', 'windowText');
     $objWriter->writeAttribute('lastClr', '000000');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:lt1
     $objWriter->startElement('a:lt1');
     // a:sysClr
     $objWriter->startElement('a:sysClr');
     $objWriter->writeAttribute('val', 'window');
     $objWriter->writeAttribute('lastClr', 'FFFFFF');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:dk2
     $objWriter->startElement('a:dk2');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '1F497D');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:lt2
     $objWriter->startElement('a:lt2');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', 'EEECE1');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:accent1
     $objWriter->startElement('a:accent1');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '4F81BD');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:accent2
     $objWriter->startElement('a:accent2');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', 'C0504D');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:accent3
     $objWriter->startElement('a:accent3');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '9BBB59');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:accent4
     $objWriter->startElement('a:accent4');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '8064A2');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:accent5
     $objWriter->startElement('a:accent5');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '4BACC6');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:accent6
     $objWriter->startElement('a:accent6');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', 'F79646');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:hlink
     $objWriter->startElement('a:hlink');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '0000FF');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:folHlink
     $objWriter->startElement('a:folHlink');
     // a:sysClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '800080');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:fontScheme
     $objWriter->startElement('a:fontScheme');
     $objWriter->writeAttribute('name', 'Office');
     // a:majorFont
     $objWriter->startElement('a:majorFont');
     // a:latin
     $objWriter->startElement('a:latin');
     $objWriter->writeAttribute('typeface', 'Cambria');
     $objWriter->endElement();
     // a:ea
     $objWriter->startElement('a:ea');
     $objWriter->writeAttribute('typeface', '');
     $objWriter->endElement();
     // a:cs
     $objWriter->startElement('a:cs');
     $objWriter->writeAttribute('typeface', '');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Jpan');
     $objWriter->writeAttribute('typeface', '?? ?????');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Hang');
     $objWriter->writeAttribute('typeface', '?? ??');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Hans');
     $objWriter->writeAttribute('typeface', '??');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Hant');
     $objWriter->writeAttribute('typeface', '????');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Arab');
     $objWriter->writeAttribute('typeface', 'Times New Roman');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Hebr');
     $objWriter->writeAttribute('typeface', 'Times New Roman');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Thai');
     $objWriter->writeAttribute('typeface', 'Tahoma');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Ethi');
     $objWriter->writeAttribute('typeface', 'Nyala');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Beng');
     $objWriter->writeAttribute('typeface', 'Vrinda');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Gujr');
     $objWriter->writeAttribute('typeface', 'Shruti');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Khmr');
     $objWriter->writeAttribute('typeface', 'MoolBoran');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Knda');
     $objWriter->writeAttribute('typeface', 'Tunga');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Guru');
     $objWriter->writeAttribute('typeface', 'Raavi');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Cans');
     $objWriter->writeAttribute('typeface', 'Euphemia');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Cher');
     $objWriter->writeAttribute('typeface', 'Plantagenet Cherokee');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Yiii');
     $objWriter->writeAttribute('typeface', 'Microsoft Yi Baiti');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Tibt');
     $objWriter->writeAttribute('typeface', 'Microsoft Himalaya');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Thaa');
     $objWriter->writeAttribute('typeface', 'MV Boli');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Deva');
     $objWriter->writeAttribute('typeface', 'Mangal');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Telu');
     $objWriter->writeAttribute('typeface', 'Gautami');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Taml');
     $objWriter->writeAttribute('typeface', 'Latha');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Syrc');
     $objWriter->writeAttribute('typeface', 'Estrangelo Edessa');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Orya');
     $objWriter->writeAttribute('typeface', 'Kalinga');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Mlym');
     $objWriter->writeAttribute('typeface', 'Kartika');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Laoo');
     $objWriter->writeAttribute('typeface', 'DokChampa');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Sinh');
     $objWriter->writeAttribute('typeface', 'Iskoola Pota');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Mong');
     $objWriter->writeAttribute('typeface', 'Mongolian Baiti');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Viet');
     $objWriter->writeAttribute('typeface', 'Times New Roman');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Uigh');
     $objWriter->writeAttribute('typeface', 'Microsoft Uighur');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:minorFont
     $objWriter->startElement('a:minorFont');
     // a:latin
     $objWriter->startElement('a:latin');
     $objWriter->writeAttribute('typeface', 'Calibri');
     $objWriter->endElement();
     // a:ea
     $objWriter->startElement('a:ea');
     $objWriter->writeAttribute('typeface', '');
     $objWriter->endElement();
     // a:cs
     $objWriter->startElement('a:cs');
     $objWriter->writeAttribute('typeface', '');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Jpan');
     $objWriter->writeAttribute('typeface', '?? ?????');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Hang');
     $objWriter->writeAttribute('typeface', '?? ??');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Hans');
     $objWriter->writeAttribute('typeface', '??');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Hant');
     $objWriter->writeAttribute('typeface', '????');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Arab');
     $objWriter->writeAttribute('typeface', 'Arial');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Hebr');
     $objWriter->writeAttribute('typeface', 'Arial');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Thai');
     $objWriter->writeAttribute('typeface', 'Tahoma');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Ethi');
     $objWriter->writeAttribute('typeface', 'Nyala');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Beng');
     $objWriter->writeAttribute('typeface', 'Vrinda');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Gujr');
     $objWriter->writeAttribute('typeface', 'Shruti');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Khmr');
     $objWriter->writeAttribute('typeface', 'DaunPenh');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Knda');
     $objWriter->writeAttribute('typeface', 'Tunga');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Guru');
     $objWriter->writeAttribute('typeface', 'Raavi');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Cans');
     $objWriter->writeAttribute('typeface', 'Euphemia');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Cher');
     $objWriter->writeAttribute('typeface', 'Plantagenet Cherokee');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Yiii');
     $objWriter->writeAttribute('typeface', 'Microsoft Yi Baiti');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Tibt');
     $objWriter->writeAttribute('typeface', 'Microsoft Himalaya');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Thaa');
     $objWriter->writeAttribute('typeface', 'MV Boli');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Deva');
     $objWriter->writeAttribute('typeface', 'Mangal');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Telu');
     $objWriter->writeAttribute('typeface', 'Gautami');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Taml');
     $objWriter->writeAttribute('typeface', 'Latha');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Syrc');
     $objWriter->writeAttribute('typeface', 'Estrangelo Edessa');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Orya');
     $objWriter->writeAttribute('typeface', 'Kalinga');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Mlym');
     $objWriter->writeAttribute('typeface', 'Kartika');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Laoo');
     $objWriter->writeAttribute('typeface', 'DokChampa');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Sinh');
     $objWriter->writeAttribute('typeface', 'Iskoola Pota');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Mong');
     $objWriter->writeAttribute('typeface', 'Mongolian Baiti');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Viet');
     $objWriter->writeAttribute('typeface', 'Arial');
     $objWriter->endElement();
     // a:font
     $objWriter->startElement('a:font');
     $objWriter->writeAttribute('script', 'Uigh');
     $objWriter->writeAttribute('typeface', 'Microsoft Uighur');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:fmtScheme
     $objWriter->startElement('a:fmtScheme');
     $objWriter->writeAttribute('name', 'Office');
     // a:fillStyleLst
     $objWriter->startElement('a:fillStyleLst');
     // a:solidFill
     $objWriter->startElement('a:solidFill');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gradFill
     $objWriter->startElement('a:gradFill');
     $objWriter->writeAttribute('rotWithShape', '1');
     // a:gsLst
     $objWriter->startElement('a:gsLst');
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '0');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:tint
     $objWriter->startElement('a:tint');
     $objWriter->writeAttribute('val', '50000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '300000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '35000');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:tint
     $objWriter->startElement('a:tint');
     $objWriter->writeAttribute('val', '37000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '300000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '100000');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:tint
     $objWriter->startElement('a:tint');
     $objWriter->writeAttribute('val', '15000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '350000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:lin
     $objWriter->startElement('a:lin');
     $objWriter->writeAttribute('ang', '16200000');
     $objWriter->writeAttribute('scaled', '1');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gradFill
     $objWriter->startElement('a:gradFill');
     $objWriter->writeAttribute('rotWithShape', '1');
     // a:gsLst
     $objWriter->startElement('a:gsLst');
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '0');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:shade
     $objWriter->startElement('a:shade');
     $objWriter->writeAttribute('val', '51000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '130000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '80000');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:shade
     $objWriter->startElement('a:shade');
     $objWriter->writeAttribute('val', '93000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '130000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '100000');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:shade
     $objWriter->startElement('a:shade');
     $objWriter->writeAttribute('val', '94000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '135000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:lin
     $objWriter->startElement('a:lin');
     $objWriter->writeAttribute('ang', '16200000');
     $objWriter->writeAttribute('scaled', '0');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:lnStyleLst
     $objWriter->startElement('a:lnStyleLst');
     // a:ln
     $objWriter->startElement('a:ln');
     $objWriter->writeAttribute('w', '9525');
     $objWriter->writeAttribute('cap', 'flat');
     $objWriter->writeAttribute('cmpd', 'sng');
     $objWriter->writeAttribute('algn', 'ctr');
     // a:solidFill
     $objWriter->startElement('a:solidFill');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:shade
     $objWriter->startElement('a:shade');
     $objWriter->writeAttribute('val', '95000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '105000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:prstDash
     $objWriter->startElement('a:prstDash');
     $objWriter->writeAttribute('val', 'solid');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:ln
     $objWriter->startElement('a:ln');
     $objWriter->writeAttribute('w', '25400');
     $objWriter->writeAttribute('cap', 'flat');
     $objWriter->writeAttribute('cmpd', 'sng');
     $objWriter->writeAttribute('algn', 'ctr');
     // a:solidFill
     $objWriter->startElement('a:solidFill');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:prstDash
     $objWriter->startElement('a:prstDash');
     $objWriter->writeAttribute('val', 'solid');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:ln
     $objWriter->startElement('a:ln');
     $objWriter->writeAttribute('w', '38100');
     $objWriter->writeAttribute('cap', 'flat');
     $objWriter->writeAttribute('cmpd', 'sng');
     $objWriter->writeAttribute('algn', 'ctr');
     // a:solidFill
     $objWriter->startElement('a:solidFill');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:prstDash
     $objWriter->startElement('a:prstDash');
     $objWriter->writeAttribute('val', 'solid');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:effectStyleLst
     $objWriter->startElement('a:effectStyleLst');
     // a:effectStyle
     $objWriter->startElement('a:effectStyle');
     // a:effectLst
     $objWriter->startElement('a:effectLst');
     // a:outerShdw
     $objWriter->startElement('a:outerShdw');
     $objWriter->writeAttribute('blurRad', '40000');
     $objWriter->writeAttribute('dist', '20000');
     $objWriter->writeAttribute('dir', '5400000');
     $objWriter->writeAttribute('rotWithShape', '0');
     // a:srgbClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '000000');
     // a:alpha
     $objWriter->startElement('a:alpha');
     $objWriter->writeAttribute('val', '38000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:effectStyle
     $objWriter->startElement('a:effectStyle');
     // a:effectLst
     $objWriter->startElement('a:effectLst');
     // a:outerShdw
     $objWriter->startElement('a:outerShdw');
     $objWriter->writeAttribute('blurRad', '40000');
     $objWriter->writeAttribute('dist', '23000');
     $objWriter->writeAttribute('dir', '5400000');
     $objWriter->writeAttribute('rotWithShape', '0');
     // a:srgbClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '000000');
     // a:alpha
     $objWriter->startElement('a:alpha');
     $objWriter->writeAttribute('val', '35000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:effectStyle
     $objWriter->startElement('a:effectStyle');
     // a:effectLst
     $objWriter->startElement('a:effectLst');
     // a:outerShdw
     $objWriter->startElement('a:outerShdw');
     $objWriter->writeAttribute('blurRad', '40000');
     $objWriter->writeAttribute('dist', '23000');
     $objWriter->writeAttribute('dir', '5400000');
     $objWriter->writeAttribute('rotWithShape', '0');
     // a:srgbClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', '000000');
     // a:alpha
     $objWriter->startElement('a:alpha');
     $objWriter->writeAttribute('val', '35000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:scene3d
     $objWriter->startElement('a:scene3d');
     // a:camera
     $objWriter->startElement('a:camera');
     $objWriter->writeAttribute('prst', 'orthographicFront');
     // a:rot
     $objWriter->startElement('a:rot');
     $objWriter->writeAttribute('lat', '0');
     $objWriter->writeAttribute('lon', '0');
     $objWriter->writeAttribute('rev', '0');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:lightRig
     $objWriter->startElement('a:lightRig');
     $objWriter->writeAttribute('rig', 'threePt');
     $objWriter->writeAttribute('dir', 't');
     // a:rot
     $objWriter->startElement('a:rot');
     $objWriter->writeAttribute('lat', '0');
     $objWriter->writeAttribute('lon', '0');
     $objWriter->writeAttribute('rev', '1200000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:sp3d
     $objWriter->startElement('a:sp3d');
     // a:bevelT
     $objWriter->startElement('a:bevelT');
     $objWriter->writeAttribute('w', '63500');
     $objWriter->writeAttribute('h', '25400');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:bgFillStyleLst
     $objWriter->startElement('a:bgFillStyleLst');
     // a:solidFill
     $objWriter->startElement('a:solidFill');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gradFill
     $objWriter->startElement('a:gradFill');
     $objWriter->writeAttribute('rotWithShape', '1');
     // a:gsLst
     $objWriter->startElement('a:gsLst');
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '0');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:tint
     $objWriter->startElement('a:tint');
     $objWriter->writeAttribute('val', '40000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '350000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '40000');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:tint
     $objWriter->startElement('a:tint');
     $objWriter->writeAttribute('val', '45000');
     $objWriter->endElement();
     // a:shade
     $objWriter->startElement('a:shade');
     $objWriter->writeAttribute('val', '99000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '350000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '100000');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:shade
     $objWriter->startElement('a:shade');
     $objWriter->writeAttribute('val', '20000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '255000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:path
     $objWriter->startElement('a:path');
     $objWriter->writeAttribute('path', 'circle');
     // a:fillToRect
     $objWriter->startElement('a:fillToRect');
     $objWriter->writeAttribute('l', '50000');
     $objWriter->writeAttribute('t', '-80000');
     $objWriter->writeAttribute('r', '50000');
     $objWriter->writeAttribute('b', '180000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gradFill
     $objWriter->startElement('a:gradFill');
     $objWriter->writeAttribute('rotWithShape', '1');
     // a:gsLst
     $objWriter->startElement('a:gsLst');
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '0');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:tint
     $objWriter->startElement('a:tint');
     $objWriter->writeAttribute('val', '80000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '300000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:gs
     $objWriter->startElement('a:gs');
     $objWriter->writeAttribute('pos', '100000');
     // a:schemeClr
     $objWriter->startElement('a:schemeClr');
     $objWriter->writeAttribute('val', 'phClr');
     // a:shade
     $objWriter->startElement('a:shade');
     $objWriter->writeAttribute('val', '30000');
     $objWriter->endElement();
     // a:satMod
     $objWriter->startElement('a:satMod');
     $objWriter->writeAttribute('val', '200000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:path
     $objWriter->startElement('a:path');
     $objWriter->writeAttribute('path', 'circle');
     // a:fillToRect
     $objWriter->startElement('a:fillToRect');
     $objWriter->writeAttribute('l', '50000');
     $objWriter->writeAttribute('t', '50000');
     $objWriter->writeAttribute('r', '50000');
     $objWriter->writeAttribute('b', '50000');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:objectDefaults
     $objWriter->writeElement('a:objectDefaults', null);
     // a:extraClrSchemeLst
     $objWriter->writeElement('a:extraClrSchemeLst', null);
     $objWriter->endElement();
     // Return
     return $objWriter->getData();
 }
Beispiel #9
0
 /**
  * Write LegacyDrawingHF
  *
  * @param	Shared_XMLWriter		$objWriter		XML Writer
  * @param	Worksheet				$pSheet			Worksheet
  * @throws	Exception
  */
 private function _writeLegacyDrawingHF(Shared_XMLWriter $objWriter = null, Worksheet $pSheet = null)
 {
     // If sheet contains comments, add the relationships
     if (count($pSheet->getHeaderFooter()->getImages()) > 0) {
         $objWriter->startElement('legacyDrawingHF');
         $objWriter->writeAttribute('r:id', 'rId_headerfooter_vml1');
         $objWriter->endElement();
     }
 }
Beispiel #10
0
 /**
  * Write Rich Text
  *
  * @param 	Shared_XMLWriter		$objWriter 		XML Writer
  * @param 	RichText				$pRichText		Rich text
  * @throws 	Exception
  */
 public function writeRichText(Shared_XMLWriter $objWriter = null, RichText $pRichText = null)
 {
     // Loop through rich text elements
     $elements = $pRichText->getRichTextElements();
     foreach ($elements as $element) {
         // r
         $objWriter->startElement('r');
         // rPr
         if ($element instanceof RichText_Run) {
             // rPr
             $objWriter->startElement('rPr');
             // rFont
             $objWriter->startElement('rFont');
             $objWriter->writeAttribute('val', $element->getFont()->getName());
             $objWriter->endElement();
             // Bold
             $objWriter->startElement('b');
             $objWriter->writeAttribute('val', $element->getFont()->getBold() ? 'true' : 'false');
             $objWriter->endElement();
             // Italic
             $objWriter->startElement('i');
             $objWriter->writeAttribute('val', $element->getFont()->getItalic() ? 'true' : 'false');
             $objWriter->endElement();
             // Superscript / subscript
             if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) {
                 $objWriter->startElement('vertAlign');
                 if ($element->getFont()->getSuperScript()) {
                     $objWriter->writeAttribute('val', 'superscript');
                 } else {
                     if ($element->getFont()->getSubScript()) {
                         $objWriter->writeAttribute('val', 'subscript');
                     }
                 }
                 $objWriter->endElement();
             }
             // Strikethrough
             $objWriter->startElement('strike');
             $objWriter->writeAttribute('val', $element->getFont()->getStrikethrough() ? 'true' : 'false');
             $objWriter->endElement();
             // Color
             $objWriter->startElement('color');
             $objWriter->writeAttribute('rgb', $element->getFont()->getColor()->getARGB());
             $objWriter->endElement();
             // Size
             $objWriter->startElement('sz');
             $objWriter->writeAttribute('val', $element->getFont()->getSize());
             $objWriter->endElement();
             // Underline
             $objWriter->startElement('u');
             $objWriter->writeAttribute('val', $element->getFont()->getUnderline());
             $objWriter->endElement();
             $objWriter->endElement();
         }
         // t
         $objWriter->startElement('t');
         $objWriter->writeAttribute('xml:space', 'preserve');
         $objWriter->writeRaw(Shared_String::ControlCharacterPHP2OOXML($element->getText()));
         $objWriter->endElement();
         $objWriter->endElement();
     }
 }