-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
This is:
- [ ] a bug report
- [x] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
Page margins get inherited from the active sheet
What is the current behavior?
Page margins are ignored completely
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE);
$sheet->getPageMargins()
->setLeft(0.1)
->setRight(0.1)
->setTop(0.1)
->setBottom(0.1)
->setHeader(0);
$sheet->setCellValue('A1', 'Test input');
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf($spreadsheet);
$writer->save('test.pdf');
Which versions of PhpSpreadsheet and PHP are affected?
All
Metadata
Metadata
Assignees
Labels
No labels