Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php
private function writeBreaks()
    {
        // initialize
        $vbreaks = [];
        $hbreaks = [];

        foreach ($this->phpSheet->getBreaks() as $cell => $breakType) {
            // Fetch coordinates
            $coordinates = Coordinate::coordinateFromString($cell);

            // Decide what to do by the type of break
            switch ($breakType) {
                case \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::BREAK_COLUMN:
                    // Add to list of vertical breaks
                    $vbreaks[] = Coordinate::columnIndexFromString($coordinates[0]) - 1;

                    break;
                case \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::BREAK_ROW:
                    // Add to list of horizontal breaks
                    $hbreaks[] = $coordinates[1];

                    break;
                case \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::BREAK_NONE:
                default:
                    // Nothing to do
                    break;
            }
        }

        //horizontal page breaks
        if (!empty($hbreaks)) {
            // Sort and filter array of page breaks
            sort($hbreaks, SORT_NUMERIC);
            if ($hbreaks[0] == 0) { // don't use first break if it's 0
                array_shift($hbreaks);
            }

            $record = 0x001b; // Record identifier
            $cbrk = count($hbreaks); // Number of page breaks
            $length = 2 + 6 * $cbrk; // Bytes to follow

            $header = pack('vv', $record, $length);
            $data = pack('v', $cbrk);

            // Append each page break
            foreach ($hbreaks as $hbreak) {
                $data .= pack('vvv', $hbreak, 0x0000, 0x00ff);
            }

            $this->append($header . $data);
        }

        // vertical page breaks
        if (!empty($vbreaks)) {
            // 1000 vertical pagebreaks appears to be an internal Excel 5 limit.
            // It is slightly higher in Excel 97/200, approx. 1026
            $vbreaks = array_slice($vbreaks, 0, 1000);

            // Sort and filter array of page breaks
            sort($vbreaks, SORT_NUMERIC);
            if ($vbreaks[0] == 0) { // don't use first break if it's 0
                array_shift($vbreaks);
            }

            $record = 0x001a; // Record identifier
            $cbrk = count($vbreaks); // Number of page breaks
            $length = 2 + 6 * $cbrk; // Bytes to follow

            $header = pack('vv', $record, $length);
            $data = pack('v', $cbrk);

            // Append each page break
            foreach ($vbreaks as $vbreak) {
                $data .= pack('vvv', $vbreak, 0x0000, 0xffff);
            }

            $this->append($header . $data);
        }
    }
private function writeBreaks()
    {
        // initialize
        $vbreaks = [];
        $hbreaks = [];

        foreach ($this->phpSheet->getBreaks() as $cell => $breakType) {
            // Fetch coordinates
            $coordinates = Coordinate::coordinateFromString($cell);

            // Decide what to do by the type of break
            switch ($breakType) {
                case \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::BREAK_COLUMN:
                    // Add to list of vertical breaks
                    $vbreaks[] = Coordinate::columnIndexFromString($coordinates[0]) - 1;

                    break;
                case \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::BREAK_ROW:
                    // Add to list of horizontal breaks
                    $hbreaks[] = $coordinates[1];

                    break;
                case \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::BREAK_NONE:
                default:
                    // Nothing to do
                    break;
            }
        }

        //horizontal page breaks
        if (!empty($hbreaks)) {
            // Sort and filter array of page breaks
            sort($hbreaks, SORT_NUMERIC);
            if ($hbreaks[0] == 0) { // don't use first break if it's 0
                array_shift($hbreaks);
            }

            $record = 0x001b; // Record identifier
            $cbrk = count($hbreaks); // Number of page breaks
            $length = 2 + 6 * $cbrk; // Bytes to follow

            $header = pack('vv', $record, $length);
            $data = pack('v', $cbrk);

            // Append each page break
            foreach ($hbreaks as $hbreak) {
                $data .= pack('vvv', $hbreak, 0x0000, 0x00ff);
            }

            $this->append($header . $data);
        }

        // vertical page breaks
        if (!empty($vbreaks)) {
            // 1000 vertical pagebreaks appears to be an internal Excel 5 limit.
            // It is slightly higher in Excel 97/200, approx. 1026
            $vbreaks = array_slice($vbreaks, 0, 1000);

            // Sort and filter array of page breaks
            sort($vbreaks, SORT_NUMERIC);
            if ($vbreaks[0] == 0) { // don't use first break if it's 0
                array_shift($vbreaks);
            }

            $record = 0x001a; // Record identifier
            $cbrk = count($vbreaks); // Number of page breaks
            $length = 2 + 6 * $cbrk; // Bytes to follow

            $header = pack('vv', $record, $length);
            $data = pack('v', $cbrk);

            // Append each page break
            foreach ($vbreaks as $vbreak) {
                $data .= pack('vvv', $vbreak, 0x0000, 0xffff);
            }

            $this->append($header . $data);
        }
    }
Write the HORIZONTALPAGEBREAKS and VERTICALPAGEBREAKS BIFF records.