summaryrefslogtreecommitdiff
path: root/sheet_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-01-17 10:35:43 +0800
committerGitHub <noreply@github.com>2019-01-17 10:35:43 +0800
commit0c5c99e2ad1478499e634d3cc42c9c261e89bba0 (patch)
tree2138dacf352af0206679e6b98a0940fef3e73050 /sheet_test.go
parent7f1323f7ac7037670848fb8ab103ace59748c28e (diff)
parent81948d9e1ee807a1e5f9b654f2edc47b121c4b0e (diff)
Merge pull request #337 from kkxkkxkkgh/paper-size
The function SetPageLayout support set paper size
Diffstat (limited to 'sheet_test.go')
-rw-r--r--sheet_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/sheet_test.go b/sheet_test.go
index e4b4700..1307dc5 100644
--- a/sheet_test.go
+++ b/sheet_test.go
@@ -19,6 +19,12 @@ func ExampleFile_SetPageLayout() {
); err != nil {
panic(err)
}
+ if err := xl.SetPageLayout(
+ "Sheet1",
+ excelize.PageLayoutPaperSize(10),
+ ); err != nil {
+ panic(err)
+ }
// Output:
}
@@ -27,15 +33,21 @@ func ExampleFile_GetPageLayout() {
const sheet = "Sheet1"
var (
orientation excelize.PageLayoutOrientation
+ paperSize excelize.PageLayoutPaperSize
)
if err := xl.GetPageLayout("Sheet1", &orientation); err != nil {
panic(err)
}
+ if err := xl.GetPageLayout("Sheet1", &paperSize); err != nil {
+ panic(err)
+ }
fmt.Println("Defaults:")
fmt.Printf("- orientation: %q\n", orientation)
+ fmt.Printf("- paper size: %d\n", paperSize)
// Output:
// Defaults:
// - orientation: "portrait"
+ // - paper size: 1
}
func TestPageLayoutOption(t *testing.T) {
@@ -46,6 +58,7 @@ func TestPageLayoutOption(t *testing.T) {
nonDefault excelize.PageLayoutOption
}{
{new(excelize.PageLayoutOrientation), excelize.PageLayoutOrientation(excelize.OrientationLandscape)},
+ {new(excelize.PageLayoutPaperSize), excelize.PageLayoutPaperSize(10)},
}
for i, test := range testData {