_grayLevel = new Zend_Pdf_Element_Numeric($grayLevel); if ($this->_grayLevel->value < 0) { $this->_grayLevel->value = 0; } if ($this->_grayLevel->value > 1) { $this->_grayLevel->value = 1; } } /** * Instructions, which can be directly inserted into content stream * to switch color. * Color set instructions differ for stroking and nonstroking operations. * * @param boolean $stroking * @return string */ public function instructions($stroking) { return $this->_grayLevel->toString() . ($stroking? " G\n" : " g\n"); } }