phpexportphpexcelworksheetpage-setup

PHPExcel does not set the papersize correct in excel 2007


SOLVED
(Solution explained under the question)

I am trying to change the page setup for a XLSX file with PHPExcel.
But whenever i change the papersize, it results in a USER defined size with the wrong width and height.

This is what i do:

$sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3);
$sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);

In the XLS file, it works correct.
But in the XLSX file not.

I already searched on google and on the forum but i could not find anything about it.
Am i doing something wrong?

I am testing in Libre Office (i also checked it on excel but it has the same problem)

The result of a XLSX file: This is the result

Let me know if you need more information.

Thanks in advance!

Solution:

It was a libreOffice bug. The problem for libre office is that it want a attribute for the printer settings. If it is not defined, it will automatically takes the printer settings.


Solution

  • It was a libreOffice bug. The problem for libre office is that it want a attribute for the printer settings. If it is not defined, it will automatically takes the printer settings.