Ejemplo n.º 1
0
 public function testToString()
 {
     $srcArray = array();
     $srcArray[] = new InternalType\BooleanObject(false);
     $srcArray[] = new InternalType\NumericObject(100.426);
     $srcArray[] = new InternalType\NameObject('MyName');
     $srcArray[] = new InternalType\StringObject('some text');
     $arrayObj = new InternalType\ArrayObject($srcArray);
     $this->assertEquals($arrayObj->toString(), '[false 100.426 /MyName (some text) ]');
 }
Ejemplo n.º 2
0
 /**
  * Set line dashing pattern
  *
  * Pattern is an array of floats: array(on_length, off_length, on_length, off_length, ...)
  * Phase is shift from the beginning of line.
  *
  * @param array $pattern
  * @param array $phase
  * @return \ZendPdf\Page
  */
 public function setLineDashingPattern($pattern, $phase = 0)
 {
     $this->_addProcSet('PDF');
     if ($pattern === self::LINE_DASHING_SOLID) {
         $pattern = array();
         $phase = 0;
     }
     $dashPattern = new InternalType\ArrayObject();
     $phaseEleemnt = new InternalType\NumericObject($phase);
     foreach ($pattern as $dashItem) {
         $dashElement = new InternalType\NumericObject($dashItem);
         $dashPattern->items[] = $dashElement;
     }
     $this->_contents .= $dashPattern->toString() . ' ' . $phaseEleemnt->toString() . " d\n";
     return $this;
 }