Author: Mario Raspe (mario.raspe@gmail.com)
Beispiel #1
0
 /**
  * @dataProvider provider
  */
 public function testGetPaperWidthAndHeightByPaperFormat($paperFormat, $expected)
 {
     $paperWidth = PHPRtfLite_Paper_Format::getPaperWidthByPaperFormat($paperFormat);
     $this->assertEquals($expected['width'], $paperWidth);
     $paperHeight = PHPRtfLite_Paper_Format::getPaperHeightByPaperFormat($paperFormat);
     $this->assertEquals($expected['height'], $paperHeight);
 }
Beispiel #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);
 }