gooxml

gooxml 是一个用于创建 Office Open XML 文档(.docx、.xlsx 和 .pptx)的库。「gooxml is a library for creation of Office Open XML documents (.docx, .xlsx and .pptx).」

Github星跟蹤圖

gooxml is a library for creation of Office Open XML documents (.docx, .xlsx
and .pptx). It's goal is to be the most compatible and highest performance Go
library for creation and editing of docx/xlsx/pptx files.

Requires go1.8+, builds are tested with 1.8, 1.9 and tip.

Build Status
GitHub (pre-)release
License: AGPL v3
GoDoc
go 1.8+

https://baliance.com/gooxml/

Status

  • Documents (docx) [Word]
    • Read/Write/Edit
    • Formatting
    • Images
    • Tables
  • Spreadsheets (xlsx) [Excel]
    • Read/Write/Edit
    • Cell formatting including conditional formatting
    • Cell validation (drop down combobox, rules, etc.)
    • Retrieve cell values as formatted by Excel (e.g. retrieve a date or number as displayed in Excel)
    • Formula Evaluation (100+ functions supported currently, more will be added as required)
    • Embedded Images
    • All chart types
  • PowerPoint (pptx) [PowerPoint]
    • Creation from templates
    • Textboxes/shapes

Performance

There has been a great deal of interest in performance numbers for spreadsheet
creation/reading lately, so here are gooxml numbers for this
benchmark
which creates a sheet with 30k rows, each with 100 columns.

creating 30000 rows * 100 cells took 3.92506863s
saving took 89ns
reading took 9.522383048s

Creation is fairly fast, saving is very quick due to no reflection usage, and
reading is a bit slower. The downside is that the binary is large (33MB) as it
contains generated structs, serialization and deserialization code for all of
DOCX/XLSX/PPTX.

Installation

go get baliance.com/gooxml/
go build -i baliance.com/gooxml/...

Document Examples

Spreadsheet Examples

Presentation Examples

Raw Types

The OOXML specification is large and creating a friendly API to cover the entire
specification is a very time consuming endeavor. This library attempts to
provide an easy to use API for common use cases in creating OOXML documents
while allowing users to fall back to raw document manipulation should the
library's API not cover a specific use case.

The raw XML based types reside in the schema/ directory. These types are
accessible from the wrapper types via a X() method that returns the raw
type.

For example, the library currently doesn't have an API for setting a document
background color. However it's easy to do manually via editing the
CT_Background element of the document.

dox := document.New()
doc.X().Background = wordprocessingml.NewCT_Background()
doc.X().Background.ColorAttr = &wordprocessingml.ST_HexColor{}
doc.X().Background.ColorAttr.ST_HexColorRGB = color.RGB(50, 50, 50).AsRGBString()

Contribution guidelines

CLA assistant

All contributors are must sign a contributor license agreement before their code
will be reviewed and merged.

Licensing

This library is offered under a dual license. It is freely available for use
under the terms of AGPLv3. If you would like to use this library for a closed
source project, please contact sales@unidoc.io.

There are no differences in functionality between the open source and commercial
versions. You are encouraged to use the open source version to evaluate the library
before purchasing a commercial license.

主要指標

概覽
名稱與所有者carmel/gooxml
主編程語言Go
編程語言Go (語言數: 4)
平台
許可證GNU Affero General Public License v3.0
所有者活动
創建於2019-12-15 12:23:50
推送於2023-06-30 03:21:24
最后一次提交2022-02-16 15:24:14
發布數0
用户参与
星數176
關注者數4
派生數71
提交數7
已啟用問題?
問題數7
打開的問題數6
拉請求數1
打開的拉請求數2
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?