Example #1
0
 function pdw_draw_line(&$obj, $params)
 {
     $this->parent =& $obj;
     $this->params =& $params;
     parent::pdw_drawing();
     if (!array_key_exists('x1', $params) || !array_key_exists('y1', $params) || !array_key_exists('x2', $params) || !array_key_exists('y2', $params)) {
         $this->_error('You must define x1,y1,x2,y2 to draw a line');
     }
     if (!array_key_exists('stroke', $params)) {
         $params['stroke'] = 'solid';
     }
     $this->office = new XMLBranch('draw:line');
     $this->office->setTagAttribute('text:anchor-type', 'paragraph');
     $this->office->setTagAttribute('draw:z-index', 0);
     $this->office->setTagAttribute('draw:style-name', 'gr' . $this->grno);
     $this->office->setTagAttribute('draw:text-style-name', 'P1');
     $this->office->setTagAttribute('svg:width', $params['w']);
     $this->office->setTagAttribute('svg:height', $params['h']);
     $this->office->setTagAttribute('svg:x1', $params['x1']);
     $this->office->setTagAttribute('svg:y1', $params['y1']);
     $this->office->setTagAttribute('svg:x2', $params['x2']);
     $this->office->setTagAttribute('svg:y2', $params['y2']);
     $this->_style($params, $this->styleprop);
     $this->_frame($params, $this->office);
 }
Example #2
0
 function pdw_draw_ellipse(&$obj, $params)
 {
     $this->parent =& $obj;
     $this->params =& $params;
     parent::pdw_drawing();
     $this->office = new XMLBranch('draw:ellipse');
     $this->office->setTagAttribute('draw:style-name', 'gr' . $this->grno);
     $this->office->setTagAttribute('draw:text-style-name', 'P1');
     $this->_style($params, $this->styleprop);
     $this->_frame($params, $this->office);
 }
Example #3
0
 function pdw_draw_caption(&$obj, $params)
 {
     $this->parent =& $obj;
     $this->params =& $params;
     parent::pdw_drawing();
     $this->office = new XMLBranch('draw:caption');
     $this->office->setTagAttribute('draw:style-name', 'gr' . $this->grno);
     $this->office->setTagAttribute('draw:text-style-name', 'P1');
     $this->office->setTagAttribute('draw:caption-point-x', $params['point-x'] . 'cm');
     $this->office->setTagAttribute('draw:caption-point-y', $params['point-y'] . 'cm');
     $this->_style($params, $this->styleprop);
     $this->_frame($params, $this->office);
 }
Example #4
0
 function pdw_draw_rectangle(&$obj, $params)
 {
     $this->parent =& $obj;
     $this->params =& $params;
     parent::pdw_drawing();
     $this->office = new XMLBranch('draw:rect');
     $this->office->setTagAttribute('draw:style-name', 'gr' . $this->grno);
     $this->office->setTagAttribute('draw:text-style-name', 'P1');
     foreach ($params as $key => $value) {
         switch ($key) {
             case "radius":
                 $this->office->setTagAttribute('draw:corner-radius', $value);
                 break;
         }
     }
     $this->_style($params, $this->styleprop);
     $this->_frame($params, $this->office);
 }
Example #5
0
 function pdw_draw_circle(&$obj, $params)
 {
     $this->parent =& $obj;
     $this->params =& $params;
     parent::pdw_drawing();
     $this->office = new XMLBranch('draw:circle');
     $this->office->setTagAttribute('draw:style-name', 'gr' . $this->grno);
     $this->office->setTagAttribute('draw:text-style-name', 'P1');
     $this->office->setTagAttribute('svg:width', $params['w'] . 'cm');
     $this->office->setTagAttribute('svg:height', $params['h'] . 'cm');
     $this->office->setTagAttribute('svg:x', $params['x'] . 'cm');
     $this->office->setTagAttribute('svg:y', $params['y'] . 'cm');
     $this->office->setTagAttribute('svg:r', $params['r'] . 'cm');
     if (!array_key_exists('kind', $params)) {
         $params['kind'] = 'full';
     }
     $this->office->setTagAttribute('draw:kind', $params['kind']);
     // 	$this->office->setTagAttribute('svg:start-angle', $params['r'].'cm');
     // 	$this->office->setTagAttribute('svg:end-angle', $params['r'].'cm');
     $this->_style($params, $this->styleprop);
     $this->_frame($params, $this->office);
 }