本文整理汇总了PHP中PHPExcel_Reader_Excel5_Escher类的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Reader_Excel5_Escher类的具体用法?PHP PHPExcel_Reader_Excel5_Escher怎么用?PHP PHPExcel_Reader_Excel5_Escher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PHPExcel_Reader_Excel5_Escher类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getReadDataOnly
//.........这里部分代码省略.........
$fill->getEndColor()->setRGB($endColor['rgb']);
}
// border colors
$top = $objStyle->getBorders()->getTop();
$right = $objStyle->getBorders()->getRight();
$bottom = $objStyle->getBorders()->getBottom();
$left = $objStyle->getBorders()->getLeft();
$diagonal = $objStyle->getBorders()->getDiagonal();
if (isset($top->colorIndex)) {
$borderTopColor = self::_readColor($top->colorIndex, $this->_palette, $this->_version);
$top->getColor()->setRGB($borderTopColor['rgb']);
}
if (isset($right->colorIndex)) {
$borderRightColor = self::_readColor($right->colorIndex, $this->_palette, $this->_version);
$right->getColor()->setRGB($borderRightColor['rgb']);
}
if (isset($bottom->colorIndex)) {
$borderBottomColor = self::_readColor($bottom->colorIndex, $this->_palette, $this->_version);
$bottom->getColor()->setRGB($borderBottomColor['rgb']);
}
if (isset($left->colorIndex)) {
$borderLeftColor = self::_readColor($left->colorIndex, $this->_palette, $this->_version);
$left->getColor()->setRGB($borderLeftColor['rgb']);
}
if (isset($diagonal->colorIndex)) {
$borderDiagonalColor = self::_readColor($diagonal->colorIndex, $this->_palette, $this->_version);
$diagonal->getColor()->setRGB($borderDiagonalColor['rgb']);
}
}
}
// treat MSODRAWINGGROUP records, workbook-level Escher
if (!$this->_readDataOnly && $this->_drawingGroupData) {
$escherWorkbook = new PHPExcel_Shared_Escher();
$reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook);
$escherWorkbook = $reader->load($this->_drawingGroupData);
// debug Escher stream
//$debug = new Debug_Escher(new PHPExcel_Shared_Escher());
//$debug->load($this->_drawingGroupData);
}
// Parse the individual sheets
foreach ($this->_sheets as $sheet) {
if ($sheet['sheetType'] != 0x0) {
// 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module
continue;
}
// check if sheet should be skipped
if (isset($this->_loadSheetsOnly) && !in_array($sheet['name'], $this->_loadSheetsOnly)) {
continue;
}
// add sheet to PHPExcel object
$this->_phpSheet = $this->_phpExcel->createSheet();
$this->_phpSheet->setTitle($sheet['name']);
$this->_phpSheet->setSheetState($sheet['sheetState']);
$this->_pos = $sheet['offset'];
// Initialize isFitToPages. May change after reading SHEETPR record.
$this->_isFitToPages = false;
// Initialize drawingData
$this->_drawingData = '';
// Initialize objs
$this->_objs = array();
// Initialize shared formula parts
$this->_sharedFormulaParts = array();
// Initialize shared formulas
$this->_sharedFormulas = array();
// Initialize text objs
$this->_textObjects = array();
示例2: load
//.........这里部分代码省略.........
break 2;
default:
$this->_readDefault();
break;
}
}
// Resolve indexed colors for font, fill, and border colors
// Cannot be resolved already in XF record, because PALETTE record comes afterwards
if (!$this->_readDataOnly) {
foreach ($this->_objFonts as $objFont) {
$color = $this->_readColor($objFont->colorIndex);
$objFont->getColor()->setRGB($color['rgb']);
}
foreach ($this->_phpExcel->getCellXfCollection() as $objStyle) {
// fill start and end color
$startColor = $this->_readColor($objStyle->getFill()->startcolorIndex);
$objStyle->getFill()->getStartColor()->setRGB($startColor['rgb']);
$endColor = $this->_readColor($objStyle->getFill()->endcolorIndex);
$objStyle->getFill()->getEndColor()->setRGB($endColor['rgb']);
// border colors
$borderTopColor = $this->_readColor($objStyle->getBorders()->getTop()->colorIndex);
$objStyle->getBorders()->getTop()->getColor()->setRGB($borderTopColor['rgb']);
$borderRightColor = $this->_readColor($objStyle->getBorders()->getRight()->colorIndex);
$objStyle->getBorders()->getRight()->getColor()->setRGB($borderRightColor['rgb']);
$borderBottomColor = $this->_readColor($objStyle->getBorders()->getBottom()->colorIndex);
$objStyle->getBorders()->getBottom()->getColor()->setRGB($borderBottomColor['rgb']);
$borderLeftColor = $this->_readColor($objStyle->getBorders()->getLeft()->colorIndex);
$objStyle->getBorders()->getLeft()->getColor()->setRGB($borderLeftColor['rgb']);
}
}
// treat MSODRAWINGGROUP records, workbook-level Escher
if (!$this->_readDataOnly && $this->_drawingGroupData) {
$escherWorkbook = new PHPExcel_Shared_Escher();
$reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook);
$escherWorkbook = $reader->load($this->_drawingGroupData);
// debug Escher stream
//$debug = new Debug_Escher(new PHPExcel_Shared_Escher());
//$debug->load($this->_drawingGroupData);
}
// Parse the individual sheets
foreach ($this->_sheets as $sheet) {
// check if sheet should be skipped
if (isset($this->_loadSheetsOnly) && !in_array($sheet['name'], $this->_loadSheetsOnly)) {
continue;
}
// add sheet to PHPExcel object
$this->_phpSheet = $this->_phpExcel->createSheet();
$this->_phpSheet->setTitle($sheet['name']);
$this->_phpSheet->setSheetState($sheet['sheetState']);
$this->_pos = $sheet['offset'];
// Initialize isFitToPages. May change after reading SHEETPR record.
$this->_isFitToPages = false;
// Initialize drawingData
$this->_drawingData = '';
// Initialize objs
$this->_objs = array();
// Initialize shared formula parts
$this->_sharedFormulaParts = array();
// Initialize shared formulas
$this->_sharedFormulas = array();
while ($this->_pos < $this->_dataSize) {
$code = $this->_GetInt2d($this->_data, $this->_pos);
switch ($code) {
case self::XLS_Type_BOF:
$length = $this->_GetInt2d($this->_data, $this->_pos + 2);
$recordData = substr($this->_data, $this->_pos + 4, $length);
示例3: _readSpContainer
/**
* Read SpContainer record (Shape Container)
*/
private function _readSpContainer()
{
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length);
// add spContainer to spgrContainer
$spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer();
$this->_object->addChild($spContainer);
// move stream pointer to next record
$this->_pos += 8 + $length;
// record is a container, read contents
$reader = new PHPExcel_Reader_Excel5_Escher($spContainer);
$escher = $reader->load($recordData);
}
示例4: load
//.........这里部分代码省略.........
// Cannot be resolved already in XF record, because PALETTE record comes afterwards
if (!$this->_readDataOnly) {
foreach ($this->_fonts as &$font) {
$font['color'] = $this->_readColor($font['colorIndex']);
}
foreach ($this->_xf as &$xf) {
// fonts
$xf['font']['color'] = $this->_readColor($xf['font']['colorIndex']);
// fill start and end color
$xf['fill']['startcolor'] = $this->_readColor($xf['fill']['startcolorIndex']);
$xf['fill']['endcolor'] = $this->_readColor($xf['fill']['endcolorIndex']);
// border colors
$xf['borders']['top']['color'] = $this->_readColor($xf['borders']['top']['colorIndex']);
$xf['borders']['right']['color'] = $this->_readColor($xf['borders']['right']['colorIndex']);
$xf['borders']['bottom']['color'] = $this->_readColor($xf['borders']['bottom']['colorIndex']);
$xf['borders']['left']['color'] = $this->_readColor($xf['borders']['left']['colorIndex']);
}
foreach ($this->_builtInStyles as &$builtInStyle) {
// fonts
$builtInStyle['font']['color'] = $this->_readColor($builtInStyle['font']['colorIndex']);
// fill start and end color
$builtInStyle['fill']['startcolor'] = $this->_readColor($builtInStyle['fill']['startcolorIndex']);
$builtInStyle['fill']['endcolor'] = $this->_readColor($builtInStyle['fill']['endcolorIndex']);
// border colors
$builtInStyle['borders']['top']['color'] = $this->_readColor($builtInStyle['borders']['top']['colorIndex']);
$builtInStyle['borders']['right']['color'] = $this->_readColor($builtInStyle['borders']['right']['colorIndex']);
$builtInStyle['borders']['bottom']['color'] = $this->_readColor($builtInStyle['borders']['bottom']['colorIndex']);
$builtInStyle['borders']['left']['color'] = $this->_readColor($builtInStyle['borders']['left']['colorIndex']);
}
}
// treat MSODRAWINGGROUP records, workbook-level Escher
if (!$this->_readDataOnly && $this->_drawingGroupData) {
$escherWorkbook = new PHPExcel_Shared_Escher();
$reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook);
$escherWorkbook = $reader->load($this->_drawingGroupData);
// debug Escher stream
//$debug = new Debug_Escher(new PHPExcel_Shared_Escher());
//$debug->load($this->_drawingGroupData);
}
// Parse the individual sheets
foreach ($this->_sheets as $sheet) {
// check if sheet should be skipped
if (isset($this->_loadSheetsOnly) && !in_array($sheet['name'], $this->_loadSheetsOnly)) {
continue;
}
// add sheet to PHPExcel object
$this->_phpSheet = $this->_phpExcel->createSheet();
$this->_phpSheet->setTitle($sheet['name']);
// default style
if (!$this->_readDataOnly && isset($this->_builtInStyles[0])) {
$this->_phpSheet->getDefaultStyle()->applyFromArray($this->_builtInStyles[0]);
}
$this->_pos = $sheet['offset'];
// Initialize isFitToPages. May change after reading SHEETPR record.
$this->_isFitToPages = false;
// Initialize drawingData
$this->_drawingData = '';
// Initialize objs
$this->_objs = array();
while ($this->_pos < $this->_dataSize) {
$code = $this->_GetInt2d($this->_data, $this->_pos);
switch ($code) {
case self::XLS_Type_BOF:
$length = $this->_GetInt2d($this->_data, $this->_pos + 2);
$recordData = substr($this->_data, $this->_pos + 4, $length);
// move stream pointer to next record