getGlobalUnit() public static method

gets global unit
public static getGlobalUnit ( ) : string
return string
Exemplo n.º 1
0
 /**
  * sets the paper format
  *
  * @param  string $paperFormat represented by class constants PAPER_*
  * @throws PHPRtfLite_Exception
  */
 public function setPaperFormat($paperFormat)
 {
     if (!isset($this->_paperFormats[$paperFormat])) {
         throw new PHPRtfLite_Exception("Paper format: '{$paperFormat}' is not supported!");
     }
     list($width, $height) = $this->_paperFormats[$paperFormat];
     $defaultUnit = PHPRtfLite_Unit::getGlobalUnit();
     $this->_paperWidth = PHPRtfLite_Unit::convertTo($width, PHPRtfLite_Unit::UNIT_CM, $defaultUnit);
     $this->_paperHeight = PHPRtfLite_Unit::convertTo($height, PHPRtfLite_Unit::UNIT_CM, $defaultUnit);
 }
Exemplo n.º 2
0
 /**
  * Sets the paper format.
  *
  * @param string $paperFormat
  */
 public function setPaperFormat($paperFormat)
 {
     $defaultUnit = PHPRtfLite_Unit::getGlobalUnit();
     $paperWidth = PHPRtfLite_Paper_Format::getPaperWidthByPaperFormat($paperFormat);
     $this->_paperWidth = PHPRtfLite_Unit::convertTo($paperWidth, PHPRtfLite_Unit::UNIT_MM, $defaultUnit);
     $paperHeight = PHPRtfLite_Paper_Format::getPaperHeightByPaperFormat($paperFormat);
     $this->_paperHeight = PHPRtfLite_Unit::convertTo($paperHeight, PHPRtfLite_Unit::UNIT_MM, $defaultUnit);
 }