Open l205306 opened 1 month ago
$sheet1->pageMargins([
'left' => '0.5',
'right' => '0.5mm',
'top' => '1.0cm',
// ...
]);
$sheet1->pageMarginLeft(0.5); // set left margin 0.5 inch $sheet1->pageMarginLeft('0.5cm'); // set left margin 0.5 centimeters $sheet1->pageMarginLeft('0.5mm'); // set left margin 0.5 millimeters
2. See https://github.com/aVadim483/fast-excel-writer/blob/master/docs/02-sheets.md#print-settings since v.6.2
The values are still differing even when I explicitly set the units to millimeters...
$sheet
->pageMargins([
'header' => '1.3cm',
'footer' => '0.5cm',
'bottom' => '0cm',
'right' => '0cm',
'top' => '0.6cm',
'left' => '0.4cm'
])
->pagePaperSize(Excel::PAPERSIZE_A3)
->pageLandscape()
->setPrintHorizontalCentered()
->pagePaperWidth('29.7cm')
->pagePaperHeight('42cm');
$spreadsheet->getActiveSheet()->getPageSetup()->setHorizontalCentered(true);
https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#center-a-page-horizontallyvertically