set document properties

This commit is contained in:
2023-02-13 12:47:06 +11:00
parent 061bb83861
commit bc71a24a83
2 changed files with 11 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"log"
"os"
"time"
"unicode/utf8"
"github.com/iancoleman/orderedmap"
@@ -92,6 +93,15 @@ func main() {
fmt.Printf("Error setting sheet name to '%s': %s\n", worksheetName, err)
}
}
// Set the document properties
err := xlsx.SetDocProps(&excelize.DocProperties{
Creator: "json2excel",
Created: time.Now().Format(time.RFC3339),
})
if err != nil {
fmt.Printf("Error setting document properties: %s\n", err)
}
}
// Read the json input file