Support pageOrder in page setup for Xlsx Reader and Writer
This commit is contained in:
parent
8712fb0424
commit
a0bba38281
|
@ -69,6 +69,9 @@ class PageSetup extends BaseParserClass
|
|||
self::boolean((string) $xmlSheet->pageSetup['useFirstPageNumber'])) {
|
||||
$docPageSetup->setFirstPageNumber((int) ($xmlSheet->pageSetup['firstPageNumber']));
|
||||
}
|
||||
if (isset($xmlSheet->pageSetup['pageOrder'])) {
|
||||
$docPageSetup->setPageOrder((string) $xmlSheet->pageSetup['pageOrder']);
|
||||
}
|
||||
|
||||
$relAttributes = $xmlSheet->pageSetup->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships');
|
||||
if (isset($relAttributes['id'])) {
|
||||
|
|
|
@ -156,6 +156,9 @@ class PageSetup
|
|||
const SETPRINTRANGE_OVERWRITE = 'O';
|
||||
const SETPRINTRANGE_INSERT = 'I';
|
||||
|
||||
const PAGEORDER_OVER_THEN_DOWN = 'overThenDown';
|
||||
const PAGEORDER_DOWN_THEN_OVER = 'downThenOver';
|
||||
|
||||
/**
|
||||
* Paper size.
|
||||
*
|
||||
|
@ -246,6 +249,8 @@ class PageSetup
|
|||
*/
|
||||
private $firstPageNumber;
|
||||
|
||||
private $pageOrder;
|
||||
|
||||
/**
|
||||
* Create a new PageSetup.
|
||||
*/
|
||||
|
@ -818,6 +823,20 @@ class PageSetup
|
|||
return $this->setFirstPageNumber(null);
|
||||
}
|
||||
|
||||
public function getPageOrder(): string
|
||||
{
|
||||
return $this->pageOrder;
|
||||
}
|
||||
|
||||
public function setPageOrder(?string $pageOrder): self
|
||||
{
|
||||
if ($pageOrder === null || $pageOrder === self::PAGEORDER_DOWN_THEN_OVER || $pageOrder === self::PAGEORDER_OVER_THEN_DOWN) {
|
||||
$this->pageOrder = $pageOrder;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
|
|
|
@ -875,6 +875,9 @@ class Worksheet extends WriterPart
|
|||
$objWriter->writeAttribute('firstPageNumber', $pSheet->getPageSetup()->getFirstPageNumber());
|
||||
$objWriter->writeAttribute('useFirstPageNumber', '1');
|
||||
}
|
||||
if ($pSheet->getPageSetup()->getPageOrder() !== null) {
|
||||
$objWriter->writeAttribute('pageOrder', $pSheet->getPageSetup()->getPageOrder());
|
||||
}
|
||||
|
||||
$getUnparsedLoadedData = $pSheet->getParent()->getUnparsedLoadedData();
|
||||
if (isset($getUnparsedLoadedData['sheets'][$pSheet->getCodeName()]['pageSetupRelId'])) {
|
||||
|
|
Loading…
Reference in New Issue