support pageOrder

This commit is contained in:
Jephté Clain 2025-01-23 11:08:51 +04:00
parent 2f3865addc
commit b721c16335
4 changed files with 17 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class ref_builder_xlsx extends ref_builder {
"page_size" => "string",
"fit_to_height" => "bool",
"fit_to_width" => "bool",
"page_order" => "string",
],
"->setPageMargin" => [
PageMargin::class,

View File

@ -517,6 +517,10 @@ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface
$xml .= " paperSize=\"{$pageSetup->paperSize->value}\"";
}
if (null !== $pageSetup->pageOrder) {
$xml .= " pageOrder=\"{$pageSetup->pageOrder->value}\"";
}
if (null !== $pageSetup->fitToHeight) {
$xml .= " fitToHeight=\"{$pageSetup->fitToHeight}\"";
}

View File

@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace OpenSpout\Writer\XLSX\Options;
enum PageOrder: string
{
case DOWN_THEN_OVER = 'downThenOver';
case OVER_THEN_DOWN = 'overThenDown';
}

View File

@ -13,6 +13,7 @@ final readonly class PageSetup
public ?PaperSize $paperSize,
public ?int $fitToHeight = null,
public ?int $fitToWidth = null,
public ?PageOrder $pageOrder = null,
) {
$this->fitToPage = null !== $fitToHeight || null !== $fitToWidth;
}