Definition at line 36 of file Drawing.php.
◆ _writeChart()
Write drawings to XML format.
- Parameters
-
- Exceptions
-
Definition at line 100 of file Drawing.php.
101 {
106
107 $objWriter->startElement(
'xdr:twoCellAnchor');
108
112 $objWriter->writeElement(
'xdr:row', $tl[
'colRow'][1] - 1);
118 $objWriter->writeElement(
'xdr:row', $br[
'colRow'][1] - 1);
121
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');
134
145
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);
157
160
162 }
static coordinateFromString($pCoordinateString='A1')
Coordinate from string.
static columnIndexFromString($pString='A')
Column index from string.
getBottomRightPosition()
Get the bottom right position of the chart.
getTopLeftPosition()
Get the top left position of the chart.
static pixelsToEMU($pValue=0)
Convert pixels to EMU.
References $objWriter, PHPExcel_Cell\columnIndexFromString(), PHPExcel_Cell\coordinateFromString(), and PHPExcel_Shared_Drawing\pixelsToEMU().
Referenced by writeDrawings().
◆ _writeDrawing()
Write drawings to XML format.
- Parameters
-
- Exceptions
-
Definition at line 172 of file Drawing.php.
173 {
174 if ($pRelationId >= 0) {
175
176 $objWriter->startElement(
'xdr:oneCellAnchor');
177
180
181
183 $objWriter->writeElement(
'xdr:col', $aCoordinates[0] - 1);
185 $objWriter->writeElement(
'xdr:row', $aCoordinates[1] - 1);
188
189
194
195
197
198
200
201
203 $objWriter->writeAttribute(
'id', $pRelationId);
207
208
210
211
213 $objWriter->writeAttribute(
'noChangeAspect',
'1');
215
217
219
220
222
223
225 $objWriter->writeAttribute(
'xmlns:r',
'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
226 $objWriter->writeAttribute(
'r:embed',
'rId' . $pRelationId);
228
229
233
235
236
238
239
243
244
247
248
250
252
253
254
255
256
257
258
259
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294 if ($pDrawing->
getShadow()->getVisible()) {
295
297
298
304 $objWriter->writeAttribute(
'rotWithShape',
'0');
305
306
309
310
314
316
318
320 }
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
370
372
373
374 $objWriter->writeElement(
'xdr:clientData',
null);
375
377 } else {
379 }
380 }
static degreesToAngle($pValue=0)
Convert degrees to angle.
getCoordinates()
Get Coordinates.
getDescription()
Get Description.
getRotation()
Get Rotation.
References $objWriter, PHPExcel_Cell\columnIndexFromString(), PHPExcel_Cell\coordinateFromString(), PHPExcel_Shared_Drawing\degreesToAngle(), and PHPExcel_Shared_Drawing\pixelsToEMU().
Referenced by writeDrawings().
◆ _writeVMLHeaderFooterImage()
Write VML comment to XML format.
- Parameters
-
- Exceptions
-
Definition at line 537 of file Drawing.php.
538 {
539
540 preg_match('{(\d+)}', md5($pReference), $m);
541 $id = 1500 + (substr($m[1], 0, 2) * 1);
542
543
548
549
551 $objWriter->writeAttribute(
'id', $pReference);
552 $objWriter->writeAttribute(
'o:spid',
'_x0000_s' . $id);
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");
555
556
558 $objWriter->writeAttribute(
'o:relid',
'rId' . $pReference);
561
562
567
569 }
References $objWriter.
Referenced by writeVMLHeaderFooterImages().
◆ allDrawings()
PHPExcel_Writer_Excel2007_Drawing::allDrawings |
( |
PHPExcel |
$pPHPExcel = null | ) |
|
Get an array of all drawings.
- Parameters
-
- Returns
- PHPExcel_Worksheet_Drawing[] All drawings in PHPExcel
- Exceptions
-
Definition at line 579 of file Drawing.php.
580 {
581
582 $aDrawings = array();
583
584
586 for ($i = 0; $i < $sheetCount; ++$i) {
587
588 $iterator = $pPHPExcel->
getSheet($i)->getDrawingCollection()->getIterator();
589 while ($iterator->valid()) {
590 $aDrawings[] = $iterator->current();
591
592 $iterator->next();
593 }
594 }
595
596 return $aDrawings;
597 }
getSheetCount()
Get sheet count.
getSheet($pIndex=0)
Get sheet by index.
◆ writeDrawings()
PHPExcel_Writer_Excel2007_Drawing::writeDrawings |
( |
PHPExcel_Worksheet |
$pWorksheet = null , |
|
|
& |
$chartRef, |
|
|
|
$includeCharts = FALSE |
|
) |
| |
Write drawings to XML format.
- Parameters
-
PHPExcel_Worksheet | $pWorksheet | |
int | &$chartRef | Chart ID |
boolean | $includeCharts | Flag indicating if we should include drawing details for charts |
- Returns
- string XML Output
- Exceptions
-
Definition at line 47 of file Drawing.php.
48 {
49
53 } else {
55 }
56
57
58 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
59
60
62 $objWriter->writeAttribute(
'xmlns:xdr',
'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing');
63 $objWriter->writeAttribute(
'xmlns:a',
'http://schemas.openxmlformats.org/drawingml/2006/main');
64
65
66 $i = 1;
68 while ($iterator->valid()) {
70
71 $iterator->next();
72 ++$i;
73 }
74
75 if ($includeCharts) {
77
78 if ($chartCount > 0) {
79 for ($c = 0; $c < $chartCount; ++$c) {
81 }
82 }
83 }
84
85
87
88
90 }
const STORAGE_MEMORY
Temporary storage method.
getChartCount()
Return the count of charts on this worksheet.
getDrawingCollection()
Get collection of drawings.
getChartByIndex($index=null)
Get a chart by its index position.
_writeDrawing(PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Worksheet_BaseDrawing $pDrawing=null, $pRelationId=-1)
Write drawings to XML format.
_writeChart(PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Chart $pChart=null, $pRelationId=-1)
Write drawings to XML format.
getParentWriter()
Get parent IWriter object.
References $objWriter, _writeChart(), _writeDrawing(), PHPExcel_Writer_Excel2007_WriterPart\getParentWriter(), PHPExcel_Shared_XMLWriter\STORAGE_DISK, and PHPExcel_Shared_XMLWriter\STORAGE_MEMORY.
◆ writeVMLHeaderFooterImages()
PHPExcel_Writer_Excel2007_Drawing::writeVMLHeaderFooterImages |
( |
PHPExcel_Worksheet |
$pWorksheet = null | ) |
|
Write VML header/footer images to XML format.
- Parameters
-
- Returns
- string XML Output
- Exceptions
-
Definition at line 389 of file Drawing.php.
390 {
391
395 } else {
397 }
398
399
400 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
401
402
404
405
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');
410
411
414
415
420
422
423
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');
432
433
435 $objWriter->writeAttribute(
'joinstyle',
'miter');
437
438
440
441
443 $objWriter->writeAttribute(
'eqn',
'if lineDrawn pixelLineWidth 0');
445
446
448 $objWriter->writeAttribute(
'eqn',
'sum @0 1 0');
450
451
453 $objWriter->writeAttribute(
'eqn',
'sum 0 0 @1');
455
456
458 $objWriter->writeAttribute(
'eqn',
'prod @2 1 2');
460
461
463 $objWriter->writeAttribute(
'eqn',
'prod @3 21600 pixelWidth');
465
466
468 $objWriter->writeAttribute(
'eqn',
'prod @3 21600 pixelHeight');
470
471
473 $objWriter->writeAttribute(
'eqn',
'sum @0 0 1');
475
476
478 $objWriter->writeAttribute(
'eqn',
'prod @6 1 2');
480
481
483 $objWriter->writeAttribute(
'eqn',
'prod @7 21600 pixelWidth');
485
486
488 $objWriter->writeAttribute(
'eqn',
'sum @8 21600 0');
490
491
493 $objWriter->writeAttribute(
'eqn',
'prod @7 21600 pixelHeight');
495
496
498 $objWriter->writeAttribute(
'eqn',
'sum @10 21600 0');
500
502
503
505 $objWriter->writeAttribute(
'o:extrusionok',
'f');
506 $objWriter->writeAttribute(
'gradientshapeok',
't');
507 $objWriter->writeAttribute(
'o:connecttype',
'rect');
509
510
513 $objWriter->writeAttribute(
'aspectratio',
't');
515
517
518
519 foreach ($images as $key => $value) {
521 }
522
524
525
527 }
getHeaderFooter()
Get page header/footer.
_writeVMLHeaderFooterImage(PHPExcel_Shared_XMLWriter $objWriter=null, $pReference='', PHPExcel_Worksheet_HeaderFooterDrawing $pImage=null)
Write VML comment to XML format.
References $objWriter, _writeVMLHeaderFooterImage(), PHPExcel_Writer_Excel2007_WriterPart\getParentWriter(), PHPExcel_Shared_XMLWriter\STORAGE_DISK, and PHPExcel_Shared_XMLWriter\STORAGE_MEMORY.
The documentation for this class was generated from the following file:
- libs/composer/vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Drawing.php