+0
Daily
4,944
stars
509
forks
77
watchers
310
prs
241
issues
79
releases
README
unioffice is a library for creation of Office Open XML documents (.docx, .xlsx
and .pptx). Its goal is to be the most compatible and highest performance Go
library for creation and editing of docx/xlsx/pptx files.
!https://github.com/unidoc/unioffice/
Status
- Documents (docx) [Word]
- Read/Write/Edit
- Formatting
- Images
- Tables
- Word to PDF (docx to pdf)
- 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 unioffice 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 github.com/unidoc/unioffice/v2
License key
This software package (unioffice) is a commercial product and requires a license code to operate.
To Get a Metered License API Key in the Free Tier, sign up on https://cloud.unidoc.io
Document Examples
- Simple Text Formatting Text font colors, sizes, highlighting, etc.
- Auto Generated Table of Contents Creating document headings with an auto generated TOC based off of the headingds
- Floating Image Placing an image somewhere on a page, absolutely positioned with different text wrapping.
- Header & Footer Creating headers and footers including page numbering.
- Multiple Headers & Footers Using different headers and footers depending on document section.
- Inline Tables Adding an table with and without borders.
- Using Existing Word Document as a Template Opening a document as a template to re-use the styles created in the document.
- Filling out Form Fields Opening a document with embedded form fields, filling out the fields and saving the result as a new filled form.
- Editing an existing document Open an existing document and replace/remove text without modifying formatting.
Spreadsheet Examples
- Simple A simple sheet with a few cells
- Named Cells Different ways of referencing rows and cells
- Cell Number/Date/Time Formats Creating cells with various number/date/time formats
- Line Chart/Line Chart 3D Line Charts
- Bar Chart Bar Charts
- Mutiple Charts Multiple charts on a single sheet
- Named Cell Ranges Naming cell ranges
- Merged Cells Merge andTop issues
#401 Office2007 is not supported6 comments · 2020-06-05#538Issue Formatting some contents of word document5 comments · 2025-04-22#277Add subDocument TargetMode="external" relationship support4 comments · 2019-05-06#370Word Fields not loaded2 comments · 2020-02-04#262Support MathType and oMathML read and write 2 comments · 2019-04-04#518Support with Pongo2 or Jinja2 templating feature1 comments · 2024-07-31#317How to open a word file with password1 comments · 2019-08-10
Latest release
v2.15.0 v2.15.0 2026-11-13Release notes - UniOffice v2.15.0 This release contains new features, improvements and bug fixes. New Features - US-1713 Password protection and encryption for Office documents: open and save password-encrypted DOCX, XLSX and PPTX files through OpenWithOptions, ReadWithOptions, SaveWithOptions and SaveToFileWithOptions (reads agile and standard AES encryption, writes agile AES-256), salted SHA-512 hashes for spreadsheet sheet and workbook protection, and a Word Restrict Editing API on Settings.DocumentProtection(). Opening with a wrong password returns ErrIncorrectPassword, and an unsu