1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-05 07:40:24 +08:00
Go to file
Gonzalo Fernández-Victorio 15fb66b7ab Create codeql-analysis.yml
For now, I'm just testing
2021-05-08 13:37:34 +01:00
2021-04-30 13:51:52 +01:00
2021-04-29 17:25:08 +01:00
2021-04-29 17:56:21 +01:00
2021-04-30 13:51:52 +01:00
2021-04-30 13:51:52 +01:00
2021-04-30 14:42:00 +01:00
2021-04-29 17:56:21 +01:00
2021-04-29 17:56:21 +01:00
2021-04-29 17:25:08 +01:00
2021-04-29 17:25:08 +01:00
2021-04-29 17:56:21 +01:00
2021-04-30 14:16:13 +01:00
2021-04-29 17:56:21 +01:00
2021-04-29 17:56:21 +01:00
2021-04-29 17:56:21 +01:00
2021-04-30 13:51:52 +01:00
2021-04-30 13:51:52 +01:00

Docx library

Yet another library to read and write .docx (Microsoft Word) files in Go.

Introduction

As part of my work for Basement Crowd y FromCounsel, we were in need of a basic library to manipulate (both read and write) Microsoft Word documents.

The difference with other projects is the following:

  • UniOffice is probably the most complete but it is also commercial (you need to pay). It also very complete, but too much for my needs.

  • gingfrederik/docx only allows to write.

There are also a couple of other projects kingzbauer/docx and nguyenthenguyen/docx

gingfrederik/docx was a heavy influence (the original structures and the main method come from that project).

However, the structures didn't handle reading and extending them was particularly difficult due to Go xml parser being limited and 6 year old bug.

Additionally, my requirements go beyond the original structure and a hard fork seemed more sensible.

The plan is to evolve the library, so the API is likely to change according to my company's needs. But please do feel free to send patches, reports and PRs or fork.

In the mean time, shared as an example.

Getting Started

Install

Go modules supported

go get github.com/gonfva/docxlib

Usage

See main for an example

$ go build -o docxlib ./main
$ ./docxlib
Preparing new document to write at /tmp/new-file.docx
Document writen.
Now trying to read it
	We've found a new run with the text ->test
	We've found a new run with the text ->test font size
	We've found a new run with the text ->test color
	We've found a new run with the text ->test font size and color
	We've found a new hyperlink with ref http://google.com and the text google
End of main

Build

$ go build ./...

License

MIT. See LICENSE

Description
One of the most functional libraries to read and write .docx files (a.k.a. Microsoft Word documents or ECMA-376 Office Open XML) in Go.
Readme AGPL-3.0 2.1 MiB
Languages
Go 100%