58 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
62 $objWriter->writeAttribute(
'xmlns:xdr',
'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing');
63 $objWriter->writeAttribute(
'xmlns:a',
'http://schemas.openxmlformats.org/drawingml/2006/main');
67 $iterator = $pWorksheet->getDrawingCollection()->getIterator();
68 while ($iterator->valid()) {
76 $chartCount = $pWorksheet->getChartCount();
78 if ($chartCount > 0) {
79 for ($c = 0; $c < $chartCount; ++$c) {
102 $tl = $pChart->getTopLeftPosition();
104 $br = $pChart->getBottomRightPosition();
107 $objWriter->startElement(
'xdr:twoCellAnchor');
112 $objWriter->writeElement(
'xdr:row', $tl[
'colRow'][1] - 1);
118 $objWriter->writeElement(
'xdr:row', $br[
'colRow'][1] - 1);
124 $objWriter->startElement(
'xdr:nvGraphicFramePr');
126 $objWriter->writeAttribute(
'name',
'Chart '.$pRelationId);
127 $objWriter->writeAttribute(
'id', 1025 * $pRelationId);
129 $objWriter->startElement(
'xdr:cNvGraphicFramePr');
130 $objWriter->startElement(
'a:graphicFrameLocks');
148 $objWriter->writeAttribute(
'uri',
'http://schemas.openxmlformats.org/drawingml/2006/chart');
150 $objWriter->writeAttribute(
'xmlns:c',
'http://schemas.openxmlformats.org/drawingml/2006/chart');
151 $objWriter->writeAttribute(
'xmlns:r',
'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
152 $objWriter->writeAttribute(
'r:id',
'rId'.$pRelationId);
174 if ($pRelationId >= 0) {
176 $objWriter->startElement(
'xdr:oneCellAnchor');
183 $objWriter->writeElement(
'xdr:col', $aCoordinates[0] - 1);
185 $objWriter->writeElement(
'xdr:row', $aCoordinates[1] - 1);
203 $objWriter->writeAttribute(
'id', $pRelationId);
204 $objWriter->writeAttribute(
'name', $pDrawing->getName());
205 $objWriter->writeAttribute(
'descr', $pDrawing->getDescription());
213 $objWriter->writeAttribute(
'noChangeAspect',
'1');
225 $objWriter->writeAttribute(
'xmlns:r',
'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
226 $objWriter->writeAttribute(
'r:embed',
'rId' . $pRelationId);
294 if ($pDrawing->getShadow()->getVisible()) {
303 $objWriter->writeAttribute(
'algn', $pDrawing->getShadow()->getAlignment());
304 $objWriter->writeAttribute(
'rotWithShape',
'0');
308 $objWriter->writeAttribute(
'val', $pDrawing->getShadow()->getColor()->getRGB());
312 $objWriter->writeAttribute(
'val', $pDrawing->getShadow()->getAlpha() * 1000);
374 $objWriter->writeElement(
'xdr:clientData', null);
400 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
403 $images = $pWorksheet->getHeaderFooter()->getImages();
407 $objWriter->writeAttribute(
'xmlns:v',
'urn:schemas-microsoft-com:vml');
408 $objWriter->writeAttribute(
'xmlns:o',
'urn:schemas-microsoft-com:office:office');
409 $objWriter->writeAttribute(
'xmlns:x',
'urn:schemas-microsoft-com:office:excel');
425 $objWriter->writeAttribute(
'id',
'_x0000_t75');
426 $objWriter->writeAttribute(
'coordsize',
'21600,21600');
428 $objWriter->writeAttribute(
'o:preferrelative',
't');
429 $objWriter->writeAttribute(
'path',
'm@4@5l@4@11@9@11@9@5xe');
435 $objWriter->writeAttribute(
'joinstyle',
'miter');
443 $objWriter->writeAttribute(
'eqn',
'if lineDrawn pixelLineWidth 0');
448 $objWriter->writeAttribute(
'eqn',
'sum @0 1 0');
453 $objWriter->writeAttribute(
'eqn',
'sum 0 0 @1');
458 $objWriter->writeAttribute(
'eqn',
'prod @2 1 2');
463 $objWriter->writeAttribute(
'eqn',
'prod @3 21600 pixelWidth');
468 $objWriter->writeAttribute(
'eqn',
'prod @3 21600 pixelHeight');
473 $objWriter->writeAttribute(
'eqn',
'sum @0 0 1');
478 $objWriter->writeAttribute(
'eqn',
'prod @6 1 2');
483 $objWriter->writeAttribute(
'eqn',
'prod @7 21600 pixelWidth');
488 $objWriter->writeAttribute(
'eqn',
'sum @8 21600 0');
493 $objWriter->writeAttribute(
'eqn',
'prod @7 21600 pixelHeight');
498 $objWriter->writeAttribute(
'eqn',
'sum @10 21600 0');
505 $objWriter->writeAttribute(
'o:extrusionok',
'f');
506 $objWriter->writeAttribute(
'gradientshapeok',
't');
507 $objWriter->writeAttribute(
'o:connecttype',
'rect');
513 $objWriter->writeAttribute(
'aspectratio',
't');
519 foreach ($images as
$key => $value) {
540 preg_match(
'{(\d+)}', md5($pReference),
$m);
541 $id = 1500 + (substr(
$m[1], 0, 2) * 1);
544 $width = $pImage->getWidth();
545 $height = $pImage->getHeight();
546 $marginLeft = $pImage->getOffsetX();
547 $marginTop = $pImage->getOffsetY();
551 $objWriter->writeAttribute(
'id', $pReference);
553 $objWriter->writeAttribute(
'type',
'#_x0000_t75');
554 $objWriter->writeAttribute(
'style',
"position:absolute;margin-left:{$marginLeft}px;margin-top:{$marginTop}px;width:{$width}px;height:{$height}px;z-index:1");
558 $objWriter->writeAttribute(
'o:relid',
'rId' . $pReference);
559 $objWriter->writeAttribute(
'o:title', $pImage->getName());
582 $aDrawings =
array();
585 $sheetCount = $pPHPExcel->getSheetCount();
586 for (
$i = 0;
$i < $sheetCount; ++
$i) {
588 $iterator = $pPHPExcel->getSheet(
$i)->getDrawingCollection()->getIterator();
589 while ($iterator->valid()) {
590 $aDrawings[] = $iterator->current();
allDrawings(PHPExcel $pPHPExcel=null)
Get an array of all drawings.
writeVMLHeaderFooterImages(PHPExcel_Worksheet $pWorksheet=null)
Write VML header/footer images to XML format.
static coordinateFromString($pCoordinateString='A1')
Coordinate from string.
_writeDrawing(PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Worksheet_BaseDrawing $pDrawing=null, $pRelationId=-1)
Write drawings to XML format.
static pixelsToEMU($pValue=0)
Convert pixels to EMU.
if(!array_key_exists('StateId', $_REQUEST)) $id
getParentWriter()
Get parent IWriter object.
writeDrawings(PHPExcel_Worksheet $pWorksheet=null, &$chartRef, $includeCharts=FALSE)
Write drawings to XML format.
static degreesToAngle($pValue=0)
Convert degrees to angle.
Create styles array
The data for the language used.
static columnIndexFromString($pString='A')
Column index from string.
_writeChart(PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Chart $pChart=null, $pRelationId=-1)
Write drawings to XML format.
_writeVMLHeaderFooterImage(PHPExcel_Shared_XMLWriter $objWriter=null, $pReference='', PHPExcel_Worksheet_HeaderFooterDrawing $pImage=null)
Write VML comment to XML format.
const STORAGE_MEMORY
Temporary storage method.