当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Writer_Excel5_Escher::getSpOffsets方法代码示例

本文整理汇总了PHP中PHPExcel_Writer_Excel5_Escher::getSpOffsets方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Writer_Excel5_Escher::getSpOffsets方法的具体用法?PHP PHPExcel_Writer_Excel5_Escher::getSpOffsets怎么用?PHP PHPExcel_Writer_Excel5_Escher::getSpOffsets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Writer_Excel5_Escher的用法示例。


在下文中一共展示了PHPExcel_Writer_Excel5_Escher::getSpOffsets方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _writeMsoDrawing

 /**
  * Write MSODRAWING record
  */
 private function _writeMsoDrawing()
 {
     // write the Escher stream if necessary
     if (isset($this->_escher)) {
         $writer = new PHPExcel_Writer_Excel5_Escher($this->_escher);
         $data = $writer->close();
         $spOffsets = $writer->getSpOffsets();
         $spTypes = $writer->getSpTypes();
         // write the neccesary MSODRAWING, OBJ records
         // split the Escher stream
         $spOffsets[0] = 0;
         $nm = count($spOffsets) - 1;
         // number of shapes excluding first shape
         for ($i = 1; $i <= $nm; ++$i) {
             // MSODRAWING record
             $record = 0xec;
             // Record identifier
             // chunk of Escher stream for one shape
             $dataChunk = substr($data, $spOffsets[$i - 1], $spOffsets[$i] - $spOffsets[$i - 1]);
             $length = strlen($dataChunk);
             $header = pack("vv", $record, $length);
             $this->_append($header . $dataChunk);
             // OBJ record
             $record = 0x5d;
             // record identifier
             $objData = '';
             // ftCmo
             if ($spTypes[$i] == 0xc9) {
                 // Add ftCmo (common object data) subobject
                 $objData .= pack('vvvvvVVV', 0x15, 0x12, 0x14, $i, 0x2101, 0, 0, 0);
                 // Add ftSbs Scroll bar subobject
                 $objData .= pack('vv', 0xc, 0x14);
                 $objData .= pack('H*', '0000000000000000640001000A00000010000100');
                 // Add ftLbsData (List box data) subobject
                 $objData .= pack('vv', 0x13, 0x1fee);
                 $objData .= pack('H*', '00000000010001030000020008005700');
             } else {
                 // Add ftCmo (common object data) subobject
                 $objData .= pack('vvvvvVVV', 0x15, 0x12, 0x8, $i, 0x6011, 0, 0, 0);
             }
             // ftEnd
             $objData .= pack('vv', 0x0, 0x0);
             $length = strlen($objData);
             $header = pack('vv', $record, $length);
             $this->_append($header . $objData);
         }
     }
 }
开发者ID:ljhchshm,项目名称:weixin,代码行数:51,代码来源:Worksheet.php

示例2: _writeMsoDrawing

 /**
  * Write MSODRAWING record
  */
 private function _writeMsoDrawing()
 {
     // write the Escher stream if necessary
     if (isset($this->_escher)) {
         $writer = new PHPExcel_Writer_Excel5_Escher($this->_escher);
         $data = $writer->close();
         $spOffsets = $writer->getSpOffsets();
         // write the neccesary MSODRAWING, OBJ records
         // split the Escher stream
         $spOffsets[0] = 0;
         $nm = count($spOffsets) - 1;
         // number of shapes excluding first shape
         for ($i = 1; $i <= $nm; ++$i) {
             // MSODRAWING record
             $record = 0xec;
             // Record identifier
             // chunk of Escher stream for one shape
             $dataChunk = substr($data, $spOffsets[$i - 1], $spOffsets[$i] - $spOffsets[$i - 1]);
             $length = strlen($dataChunk);
             $header = pack("vv", $record, $length);
             $this->_append($header . $dataChunk);
             // OBJ record
             $record = 0x5d;
             // record identifier
             $objData = '';
             // ftCmo
             $objData .= pack('vvvvvVVV', 0x15, 0x12, 0x8, $i, 0x6011, 0, 0, 0);
             // ftEnd
             $objData .= pack('vv', 0x0, 0x0);
             $length = strlen($objData);
             $header = pack('vv', $record, $length);
             $this->_append($header . $objData);
         }
     }
 }
开发者ID:yunsite,项目名称:tp-coupon,代码行数:38,代码来源:Worksheet.php

示例3: close

 /**
  * Process the object to be written
  */
 public function close()
 {
     // initialize
     $this->_data = '';
     switch (get_class($this->_object)) {
         case 'PHPExcel_Shared_Escher':
             if ($dggContainer = $this->_object->getDggContainer()) {
                 $writer = new PHPExcel_Writer_Excel5_Escher($dggContainer);
                 $this->_data = $writer->close();
             } else {
                 if ($dgContainer = $this->_object->getDgContainer()) {
                     $writer = new PHPExcel_Writer_Excel5_Escher($dgContainer);
                     $this->_data = $writer->close();
                     $this->_spOffsets = $writer->getSpOffsets();
                 }
             }
             break;
         case 'PHPExcel_Shared_Escher_DggContainer':
             // this is a container record
             // initialize
             $innerData = '';
             // write the dgg
             $recVer = 0x0;
             $recInstance = 0x0;
             $recType = 0xf006;
             $recVerInstance = $recVer;
             $recVerInstance |= $recInstance << 4;
             // dgg data
             $dggData = pack('VVVV', $this->_object->getSpIdMax(), $this->_object->getCDgSaved() + 1, $this->_object->getCSpSaved(), $this->_object->getCDgSaved());
             // add file identifier clusters (one per drawing)
             for ($i = 0; $i < $this->_object->getCDgSaved(); ++$i) {
                 $dggData .= pack('VV', 0, 0);
             }
             $header = pack('vvV', $recVerInstance, $recType, strlen($dggData));
             $innerData .= $header . $dggData;
             // write the bstoreContainer
             if ($bstoreContainer = $this->_object->getBstoreContainer()) {
                 $writer = new PHPExcel_Writer_Excel5_Escher($bstoreContainer);
                 $innerData .= $writer->close();
             }
             // write the record
             $recVer = 0xf;
             $recInstance = 0x0;
             $recType = 0xf000;
             $length = strlen($innerData);
             $recVerInstance = $recVer;
             $recVerInstance |= $recInstance << 4;
             $header = pack('vvV', $recVerInstance, $recType, $length);
             $this->_data = $header . $innerData;
             break;
         case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer':
             // this is a container record
             // initialize
             $innerData = '';
             // treat the inner data
             if ($BSECollection = $this->_object->getBSECollection()) {
                 foreach ($BSECollection as $BSE) {
                     $writer = new PHPExcel_Writer_Excel5_Escher($BSE);
                     $innerData .= $writer->close();
                 }
             }
             // write the record
             $recVer = 0xf;
             $recInstance = count($this->_object->getBSECollection());
             $recType = 0xf001;
             $length = strlen($innerData);
             $recVerInstance = $recVer;
             $recVerInstance |= $recInstance << 4;
             $header = pack('vvV', $recVerInstance, $recType, $length);
             $this->_data = $header . $innerData;
             break;
         case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE':
             // this is a semi-container record
             // initialize
             $innerData = '';
             // here we treat the inner data
             if ($blip = $this->_object->getBlip()) {
                 $writer = new PHPExcel_Writer_Excel5_Escher($blip);
                 $innerData .= $writer->close();
             }
             // initialize
             $data = '';
             $btWin32 = $this->_object->getBlipType();
             $btMacOS = $this->_object->getBlipType();
             $data .= pack('CC', $btWin32, $btMacOS);
             $rgbUid = pack('VVVV', 0, 0, 0, 0);
             // todo
             $data .= $rgbUid;
             $tag = 0;
             $size = strlen($innerData);
             $cRef = 1;
             $foDelay = 0;
             //todo
             $unused1 = 0x0;
             $cbName = 0x0;
             $unused2 = 0x0;
             $unused3 = 0x0;
//.........这里部分代码省略.........
开发者ID:nagiro,项目名称:hospici_cultural,代码行数:101,代码来源:Escher.php

示例4: _writeMsoDrawing

 /**
  * Write MSODRAWING record
  */
 private function _writeMsoDrawing()
 {
     // check if there are any shapes for this sheet
     if (count($this->_phpSheet->getDrawingCollection()) == 0) {
         return;
     }
     // create intermediate Escher object
     $escher = new PHPExcel_Shared_Escher();
     // dgContainer
     $dgContainer = new PHPExcel_Shared_Escher_DgContainer();
     // set the drawing index (we use sheet index + 1)
     $dgContainer->setDgId($this->_phpSheet->getParent()->getIndex($this->_phpSheet) + 1);
     $escher->setDgContainer($dgContainer);
     // spgrContainer
     $spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer();
     $dgContainer->setSpgrContainer($spgrContainer);
     // add one shape which is the group shape
     $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer();
     $spContainer->setSpgr(true);
     $spContainer->setSpType(0);
     $spContainer->setSpId($this->_phpSheet->getParent()->getIndex($this->_phpSheet) + 1 << 10);
     $spgrContainer->addChild($spContainer);
     // add the shapes
     // outer loop is for determining BSE index
     $blipIndex = 0;
     // 1-based index to BstoreContainer
     $countShapes = 0;
     // count number of shapes (minus group shape), in this sheet
     foreach ($this->_phpSheet->getParent()->getAllsheets() as $sheet) {
         foreach ($sheet->getDrawingCollection() as $drawing) {
             ++$blipIndex;
             if ($sheet === $this->_phpSheet) {
                 ++$countShapes;
                 // add the shape
                 $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer();
                 // set the shape type
                 $spContainer->setSpType(0x4b);
                 // set the shape index (we combine 1-based sheet index and $countShapes to create unique shape index)
                 $spId = $countShapes | $this->_phpSheet->getParent()->getIndex($this->_phpSheet) + 1 << 10;
                 $spContainer->setSpId($spId);
                 // keep track of last spId
                 $lastSpId = $spId;
                 // set the BLIP index
                 $spContainer->setOPT(0x4104, $blipIndex);
                 // set coordinates and offsets, client anchor
                 $coordinates = $drawing->getCoordinates();
                 $offsetX = $drawing->getOffsetX();
                 $offsetY = $drawing->getOffsetY();
                 $width = $drawing->getWidth();
                 $height = $drawing->getHeight();
                 $twoAnchor = PHPExcel_Shared_Excel5::oneAnchor2twoAnchor($this->_phpSheet, $coordinates, $offsetX, $offsetY, $width, $height);
                 $spContainer->setStartCoordinates($twoAnchor['startCoordinates']);
                 $spContainer->setStartOffsetX($twoAnchor['startOffsetX']);
                 $spContainer->setStartOffsetY($twoAnchor['startOffsetY']);
                 $spContainer->setEndCoordinates($twoAnchor['endCoordinates']);
                 $spContainer->setEndOffsetX($twoAnchor['endOffsetX']);
                 $spContainer->setEndOffsetY($twoAnchor['endOffsetY']);
                 $spgrContainer->addChild($spContainer);
             }
         }
     }
     // set last shape index
     $dgContainer->setLastSpId($lastSpId);
     // write the Escher stream
     $writer = new PHPExcel_Writer_Excel5_Escher($escher);
     $data = $writer->close();
     $spOffsets = $writer->getSpOffsets();
     // write the neccesary MSODRAWING, OBJ records
     // split the Escher stream
     $spOffsets[0] = 0;
     $nm = count($spOffsets) - 1;
     // number of shapes excluding first shape
     for ($i = 1; $i <= $nm; ++$i) {
         // MSODRAWING record
         $record = 0xec;
         // Record identifier
         // chunk of Escher stream for one shape
         $dataChunk = substr($data, $spOffsets[$i - 1], $spOffsets[$i] - $spOffsets[$i - 1]);
         $length = strlen($dataChunk);
         $header = pack("vv", $record, $length);
         $this->_append($header . $dataChunk);
         // OBJ record
         $record = 0x5d;
         // record identifier
         $objData = '';
         // ftCmo
         $objData .= pack('vvvvvVVV', 0x15, 0x12, 0x8, $i, 0x6011, 0, 0, 0);
         // ftEnd
         $objData .= pack('vv', 0x0, 0x0);
         $length = strlen($objData);
         $header = pack('vv', $record, $length);
         $this->_append($header . $objData);
     }
 }
开发者ID:kumarsivarajan,项目名称:ctrl-dock,代码行数:97,代码来源:Worksheet.php

示例5: _writeMsoDrawing

	/**
	 * Write MSODRAWING record
	 */
	private function _writeMsoDrawing() {
		// write the Escher stream if necessary
		if (isset ( $this->_escher )) {
			$writer = new PHPExcel_Writer_Excel5_Escher ( $this->_escher );
			$data = $writer->close ();
			$spOffsets = $writer->getSpOffsets ();
			
			// write the neccesary MSODRAWING, OBJ records
			
			// split the Escher stream
			$spOffsets [0] = 0;
			$nm = count ( $spOffsets ) - 1; // number of shapes excluding first shape
			for($i = 1; $i <= $nm; ++ $i) {
				// MSODRAWING record
				$record = 0x00EC; // Record identifier
				                  
				// chunk of Escher stream for one shape
				
				$dataChunk = substr ( $data, $spOffsets [$i - 1], $spOffsets [$i] - $spOffsets [$i - 1] );
				
				$length = strlen ( $dataChunk );
				$header = pack ( "vv", $record, $length );
				
				$this->_append ( $header . $dataChunk );
				
				// OBJ record
				$record = 0x005D; // record identifier
				$objData = '';
				
				// ftCmo
				$objData .= pack ( 'vvvvvVVV', 0x0015, 				// 0x0015 = ftCmo
				0x0012, 				// length of ftCmo data
				0x0008, 				// object type, 0x0008 = picture
				$i, 				// object id number, Excel seems to use 1-based index, local
				     // for the sheet
				0x6011, 				// option flags, 0x6011 is what OpenOffice.org uses
				0, 				// reserved
				0, 				// reserved
				0 )				// reserved
				;
				// ftEnd
				$objData .= pack ( 'vv', 0x0000, 				// 0x0000 = ftEnd
				0x0000 )				// length of ftEnd data
				;
				
				$length = strlen ( $objData );
				$header = pack ( 'vv', $record, $length );
				$this->_append ( $header . $objData );
			}
		}
	}
开发者ID:nanpeixoto,项目名称:cide,代码行数:54,代码来源:Worksheet.php

示例6: _writeMsoDrawing

	/**
	 * Write MSODRAWING record
	 */
	private function _writeMsoDrawing()
	{
		// write the Escher stream if necessary
		if (isset($this->_escher)) {
			$writer = new PHPExcel_Writer_Excel5_Escher($this->_escher);
			$data = $writer->close();
			$spOffsets = $writer->getSpOffsets();
			$spTypes = $writer->getSpTypes();
			// write the neccesary MSODRAWING, OBJ records

			// split the Escher stream
			$spOffsets[0] = 0;
			$nm = count($spOffsets) - 1; // number of shapes excluding first shape
			for ($i = 1; $i <= $nm; ++$i) {
				// MSODRAWING record
				$record = 0x00EC;			// Record identifier

				// chunk of Escher stream for one shape
				$dataChunk = substr($data, $spOffsets[$i -1], $spOffsets[$i] - $spOffsets[$i - 1]);

				$length = strlen($dataChunk);
				$header = pack("vv", $record, $length);

				$this->_append($header . $dataChunk);

				// OBJ record
				$record = 0x005D; // record identifier
				$objData = '';

				// ftCmo
				if($spTypes[$i] == 0x00C9){
					// Add ftCmo (common object data) subobject
					$objData .=
						pack('vvvvvVVV'
								, 0x0015	// 0x0015 = ftCmo
								, 0x0012	// length of ftCmo data
								, 0x0014	// object type, 0x0014 = filter
								, $i		// object id number, Excel seems to use 1-based index, local for the sheet
								, 0x2101	// option flags, 0x2001 is what OpenOffice.org uses
								, 0			// reserved
								, 0			// reserved
								, 0			// reserved
						);

					// Add ftSbs Scroll bar subobject
					$objData .= pack('vv', 0x00C, 0x0014);
					$objData .= pack('H*', '0000000000000000640001000A00000010000100');
					// Add ftLbsData (List box data) subobject
					$objData .= pack('vv', 0x0013, 0x1FEE);
					$objData .= pack('H*', '00000000010001030000020008005700');
				}
				else {
					// Add ftCmo (common object data) subobject
					$objData .=
						pack('vvvvvVVV'
							, 0x0015	// 0x0015 = ftCmo
							, 0x0012	// length of ftCmo data
							, 0x0008	// object type, 0x0008 = picture
							, $i		// object id number, Excel seems to use 1-based index, local for the sheet
							, 0x6011	// option flags, 0x6011 is what OpenOffice.org uses
							, 0			// reserved
							, 0			// reserved
							, 0			// reserved
						);
				}

				// ftEnd
				$objData .=
					pack('vv'
						, 0x0000	// 0x0000 = ftEnd
						, 0x0000	// length of ftEnd data
					);

				$length = strlen($objData);
				$header = pack('vv', $record, $length);
				$this->_append($header . $objData);
			}
		}
	}
开发者ID:rmuyinda,项目名称:dms-1,代码行数:82,代码来源:Worksheet.php


注:本文中的PHPExcel_Writer_Excel5_Escher::getSpOffsets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。