Beispiel #1
0
 /**
  * Read SCL record
  */
 private function _readScl()
 {
     $length = $this->_GetInt2d($this->_data, $this->_pos + 2);
     $recordData = substr($this->_data, $this->_pos + 4, $length);
     // move stream pointer to next record
     $this->_pos += 4 + $length;
     // offset: 0; size: 2; numerator of the view magnification
     $numerator = $this->_GetInt2d($recordData, 0);
     // offset: 2; size: 2; numerator of the view magnification
     $denumerator = $this->_GetInt2d($recordData, 2);
     // set the zoom scale (in percent)
     $this->_phpSheet->getSheetView()->setZoomScale($numerator * 100 / $denumerator);
 }
Beispiel #2
0
 /**
  * Store the window zoom factor. This should be a reduced fraction but for
  * simplicity we will store all fractions with a numerator of 100.
  */
 private function _writeZoom()
 {
     // If scale is 100 we don't need to write a record
     if ($this->_phpSheet->getSheetView()->getZoomScale() == 100) {
         return;
     }
     $record = 0xa0;
     // Record identifier
     $length = 0x4;
     // Bytes to follow
     $header = pack("vv", $record, $length);
     $data = pack("vv", $this->_phpSheet->getSheetView()->getZoomScale(), 100);
     $this->_append($header . $data);
 }