mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
25 lines
673 B
Go
25 lines
673 B
Go
package unioffice_test
|
|
|
|
import (
|
|
"github.com/unidoc/unioffice/document"
|
|
"github.com/unidoc/unioffice/spreadsheet"
|
|
)
|
|
|
|
func Example_document() {
|
|
// see the github.com/unidoc/unioffice/document documentation or _examples/document
|
|
// for more examples
|
|
doc := document.New()
|
|
doc.AddParagraph().AddRun().AddText("Hello World!")
|
|
doc.SaveToFile("document.docx")
|
|
}
|
|
|
|
func Example_spreadsheeet() {
|
|
// see the github.com/unidoc/unioffice/spreadsheet documentation or _examples/spreadsheet
|
|
// for more examples
|
|
ss := spreadsheet.New()
|
|
sheet := ss.AddSheet()
|
|
sheet.AddRow().AddCell().SetString("Hello")
|
|
sheet.Cell("B1").SetString("World!")
|
|
ss.SaveToFile("workbook.xlsx")
|
|
}
|