code: private function writePrintOptions(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
      {
          // printOptions
          $objWriter->startElement('printOptions');
  
          $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true' : 'false'));
          $objWriter->writeAttribute('gridLinesSet', 'true');
  
          if ($pSheet->getPageSetup()->getHorizontalCentered()) {
              $objWriter->writeAttribute('horizontalCentered', 'true');
          }
  
          if ($pSheet->getPageSetup()->getVerticalCentered()) {
              $objWriter->writeAttribute('verticalCentered', 'true');
          }
  
          $objWriter->endElement();
      }
docs: Write PrintOptions.
  
  @param XMLWriter $objWriter XML Writer
  @param PhpspreadsheetWorksheet $pSheet Worksheet