Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Simple pure Go (golang) library for creating DOCX file

License

Notifications You must be signed in to change notification settings

gingfrederik/docx

Repository files navigation

docx

GitHub release (latest SemVer) Go Report Card GoDoc

Introduction

docx is a simple library to creating DOCX file in Go.

Getting Started

Install

Go modules supported

go get github.com/gingfrederik/docx

Import:

import "github.com/gingfrederik/docx"

Usage

Example:

package main

import (
	"github.com/gingfrederik/docx"
)

func main() {
	f := docx.NewFile()
	// add new paragraph
	para := f.AddParagraph()
	// add text
	para.AddText("test")

	para.AddText("test font size").Size(22)
	para.AddText("test color").Color("808080")
	para.AddText("test font size and color").Size(22).Color("121212")

	nextPara := f.AddParagraph()
	nextPara.AddLink("google", `http://google.com`)

	f.Save("./test.docx")
}

About

Simple pure Go (golang) library for creating DOCX file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages