Skip to content
pubscout

docs_gee

1.5.1, released 5 weeks ago by codigee.com

Generate Microsoft Word DOCX and PDF documents in pure Dart.

WASM-ready
$ flutter pub add docs_gee
Source repository

What it does

A pure Dart library for generating and reading DOCX and PDF documents from a single document model. It supports rich text formatting, tables, lists, images, headers, and footers across all platforms without native dependencies.

AI-written summary of version 1.5.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to generate Microsoft Word or PDF files programmatically from Dart or Flutter.
  • You require cross-platform document generation without relying on native platform SDKs.
  • You want to share the same document model for both DOCX and PDF output formats.

Skip it when

  • You need complex PDF features like bidirectional text shaping, which are not supported for PDFs.
  • You require advanced layout rendering not expressible via the provided paragraph and table models.

Strengths

  • Pure Dart with no native dependencies, making it work on iOS, Android, Web, macOS, Windows, and Linux.
  • Dual format generation (DOCX and PDF) from a single document model.
  • Lightweight with only a single dependency on the archive package.

Weaknesses

  • PDF generator lacks support for certain DOCX-only features like headers, footers, right-to-left text, and images.
  • PDF support for Polish characters is partial due to font encoding limitations.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
import 'dart:io';
import 'package:docs_gee/docs_gee.dart';

void main() {
  final doc = Document(title: 'My Report', author: 'John Doe');
  doc.addParagraph(Paragraph.heading('Quarterly Report', level: 1));
  doc.addParagraph(Paragraph.text('This report summarizes Q4 performance.'));
  File('report.docx').writeAsBytesSync(DocxGenerator().generate(doc));
  File('report.pdf').writeAsBytesSync(PdfGenerator().generate(doc));
}

Alternatives

Packages that do the same job and could replace docs_gee.

Works with

Packages commonly used together with docs_gee: ones it builds on, ones built on it, and its own family.