how to set page orientation(landscape or portrait) in phpspreadsheet

血红的双手。 提交于 2021-01-28 13:40:47

问题


I want to set pagesetup in excel using phpspreadsheet. I found to do it using phpexcel from here. I do not know what to replace at PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT.

$sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);

Thanks in advance.


回答1:


I found the answer. I tried it after go through PageSetup.php in PHPSpreadsheet.

$sheet->getPageSetup()->setOrientation(PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT);


来源:https://stackoverflow.com/questions/54939915/how-to-set-page-orientationlandscape-or-portrait-in-phpspreadsheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!