private function PHPExcel_Writer_Excel5_Worksheet::_writeSetup in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php \PHPExcel_Writer_Excel5_Worksheet::_writeSetup()
* Store the page setup SETUP BIFF record.
1 call to PHPExcel_Writer_Excel5_Worksheet::_writeSetup()
- PHPExcel_Writer_Excel5_Worksheet::close in vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ Excel5/ Worksheet.php - * Add data to the beginning of the workbook (note the reverse order) * and to the end of the workbook. * * @access public *
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ Excel5/ Worksheet.php, line 1812
Class
- PHPExcel_Writer_Excel5_Worksheet
- PHPExcel_Writer_Excel5_Worksheet
Code
private function _writeSetup() {
$record = 0xa1;
// Record identifier
$length = 0x22;
// Number of bytes to follow
$iPaperSize = $this->_phpSheet
->getPageSetup()
->getPaperSize();
// Paper size
$iScale = $this->_phpSheet
->getPageSetup()
->getScale() ? $this->_phpSheet
->getPageSetup()
->getScale() : 100;
// Print scaling factor
$iPageStart = 0x1;
// Starting page number
$iFitWidth = (int) $this->_phpSheet
->getPageSetup()
->getFitToWidth();
// Fit to number of pages wide
$iFitHeight = (int) $this->_phpSheet
->getPageSetup()
->getFitToHeight();
// Fit to number of pages high
$grbit = 0x0;
// Option flags
$iRes = 0x258;
// Print resolution
$iVRes = 0x258;
// Vertical print resolution
$numHdr = $this->_phpSheet
->getPageMargins()
->getHeader();
// Header Margin
$numFtr = $this->_phpSheet
->getPageMargins()
->getFooter();
// Footer Margin
$iCopies = 0x1;
// Number of copies
$fLeftToRight = 0x0;
// Print over then down
// Page orientation
$fLandscape = $this->_phpSheet
->getPageSetup()
->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE ? 0x0 : 0x1;
$fNoPls = 0x0;
// Setup not read from printer
$fNoColor = 0x0;
// Print black and white
$fDraft = 0x0;
// Print draft quality
$fNotes = 0x0;
// Print notes
$fNoOrient = 0x0;
// Orientation not set
$fUsePage = 0x0;
// Use custom starting page
$grbit = $fLeftToRight;
$grbit |= $fLandscape << 1;
$grbit |= $fNoPls << 2;
$grbit |= $fNoColor << 3;
$grbit |= $fDraft << 4;
$grbit |= $fNotes << 5;
$grbit |= $fNoOrient << 6;
$grbit |= $fUsePage << 7;
$numHdr = pack("d", $numHdr);
$numFtr = pack("d", $numFtr);
if (self::getByteOrder()) {
// if it's Big Endian
$numHdr = strrev($numHdr);
$numFtr = strrev($numFtr);
}
$header = pack("vv", $record, $length);
$data1 = pack("vvvvvvvv", $iPaperSize, $iScale, $iPageStart, $iFitWidth, $iFitHeight, $grbit, $iRes, $iVRes);
$data2 = $numHdr . $numFtr;
$data3 = pack("v", $iCopies);
$this
->_append($header . $data1 . $data2 . $data3);
}