Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inherit page margins from active sheet #750

Closed
Bird87ZA opened this issue Oct 30, 2018 · 1 comment
Closed

Inherit page margins from active sheet #750

Bird87ZA opened this issue Oct 30, 2018 · 1 comment

Comments

@Bird87ZA
Copy link
Contributor

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

@Bird87ZA
Copy link
Contributor Author

Bird87ZA commented Oct 30, 2018

I'm busy with a pull request for this improvement.

Bird87ZA added a commit to Bird87ZA/PhpSpreadsheet that referenced this issue Oct 30, 2018
Bird87ZA added a commit to Bird87ZA/PhpSpreadsheet that referenced this issue Oct 30, 2018
guillaume-ro-fr pushed a commit to guillaume-ro-fr/PhpSpreadsheet that referenced this issue Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant