example
<?php
/**
* Create different shapes
*
* @category Phpdocx
* @package examples
* @subpackage intermediate
* @copyright Copyright (c) 2009-2013 Narcea Producciones Multimedia S.L.
* (http://www.2mdc.com)
* @license http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
* @version 2012.12.26
* @link http://www.phpdocx.com
* @since 2012.12.26
*/
require_once '../../classes/CreateDocx.inc';
$options = array('width' => 90,
'height' => 90,
//'coordsize' => '3000,500',
'fillcolor' => '#555555',
'strokecolor' => '#ff0000',
'strokeweight' => '4',
'startAngle' => 0,
'endAngle' => 210,);
$options = array('from' => '300,40',
'to' => '120,150',
'fillcolor' => '#555555',
'strokecolor' => '#ff0000',
'strokeweight' => '4',
'control1' => '60,70',
'control2' => '125,170');
$options = array('from' => '10,10',
'to' => '150,10',
'strokecolor' => '#0000ff',
'strokeweight' => '2',
'position' => 'absolute',
'margin-left' => 20);
$options = array('points' => '10,10 20,20 25,10 40,7 3,55',
'strokecolor' => '#ff00ff',
'strokeweight' => '2',
'position' => 'absolute',
'margin-left' => 40,
'margin-bottom' => 140);
$options = array('width' => 60,
'height' => 30,
'strokecolor' => '#ff00ff',
'strokeweight' => '3',
'fillcolor' => '#ffff00',
'position' => 'absolute',
'margin-left' => 10,
'margin-top' => -5);
$docx->addText('Rounded rectangle:');
$options = array('width' => 60,
'height' => 30,
'strokecolor' => '#ff00ff',
'strokeweight' => '3',
'fillcolor' => '#ffff00',
'position' => 'absolute',
'margin-left' => 60,
'margin-top' => 2,
'arcsize' => 0.3);
$docx->addText('Arbitrary shape:');
$options = array('path' => 'm,118hdc80,65,159,24,252,v33,11,66,24,100,34c374,41,413,29,419,51v30,109,-6,202,-100,234c308,296,299,311,285,318v-31,16,-100,34,-100,34c140,341,92,339,51,318,33,309,20,288,17,268,14,251,34,218,34,218hal,118hdxe',
'width' => 50,
'height' => 50,
'strokecolor' => '#000000',
'strokeweight' => '2',
'fillcolor' => '#ff0000',
'position' => 'absolute',
'margin-left' => 5,
'margin-top' => 0);
$docx->addText('The same arbitrary shape but with negative z-index and a negative margin-top so it is drawn behind this text.');
$options = array('path' => 'm,118hdc80,65,159,24,252,v33,11,66,24,100,34c374,41,413,29,419,51v30,109,-6,202,-100,234c308,296,299,311,285,318v-31,16,-100,34,-100,34c140,341,92,339,51,318,33,309,20,288,17,268,14,251,34,218,34,218hal,118hdxe',
'width' => 100,
'height' => 100,
'strokecolor' => '#dddddd',
'strokeweight' => '2',
'fillcolor' => '#ffff00',
'position' => 'absolute',
'margin-left' => 25,
'margin-top' => -45,
'z-index' => -100);
$docx->addText('An oval with no fill color and a circle with yellow color:');
$options = array('width' => 100,
'height' => 60,
'strokecolor' => '#000000',
'strokeweight' => '2');
$options = array('width' => 100,
'height' => 100,
'strokecolor' => '#000000',
'strokeweight' => '2',
'fillcolor' => '#ffff00',
'position' => 'absolute',
'margin-top' => -75,
'margin-left' => 150);
$docx->addText('Now we are going to insert a shape in two different table cells:');
$options = array('width' => 100,
'height' => 60,
'strokecolor' => '#000000',
'strokeweight' => '2',
'rawWordML' => true);
$SHAPEdata = $docx->addShape('oval', $options);
$valuesTable = array(
array(
11,
$fragment
),
array(
$fragment,
22
),
);
$paramsTable = array(
'border' => 'single',
'border_sz' => 5,
);
$test = $docx->addTable($valuesTable, $paramsTable);
|
|