From fa6071ef52db472f42b3dd11727b5b62574b3b85 Mon Sep 17 00:00:00 2001 From: tom twinkle Date: Fri, 7 Jun 2024 12:29:29 +0900 Subject: [PATCH] feat: add SetPageLayout,GetPageLayout --- excelizeam.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/excelizeam.go b/excelizeam.go index fa7bd4a..1761f8e 100644 --- a/excelizeam.go +++ b/excelizeam.go @@ -30,6 +30,8 @@ type Excelizeam interface { // Excelize StreamWriter Wrapper SetPageMargins(options *excelize.PageLayoutMarginsOptions) error + SetPageLayout(options *excelize.PageLayoutOptions) error + GetPageLayout() (excelize.PageLayoutOptions, error) SetColWidth(colIndex int, width float64) error SetColWidthRange(colIndexMin, colIndexMax int, width float64) error MergeCell(startColIndex, startRowIndex, endColIndex, endRowIndex int) error @@ -166,6 +168,14 @@ func (e *excelizeam) SetPageMargins(options *excelize.PageLayoutMarginsOptions) ) } +func (e *excelizeam) SetPageLayout(options *excelize.PageLayoutOptions) error { + return e.file.SetPageLayout(e.sw.Sheet, options) +} + +func (e *excelizeam) GetPageLayout() (excelize.PageLayoutOptions, error) { + return e.file.GetPageLayout(e.sw.Sheet) +} + func (e *excelizeam) MergeCell(startColIndex, startRowIndex, endColIndex, endRowIndex int) error { startCell, err := excelize.CoordinatesToCellName(startColIndex, startRowIndex) if err != nil {