docx_mailmerge 1.0.3 copy "docx_mailmerge: ^1.0.3" to clipboard
docx_mailmerge: ^1.0.3 copied to clipboard

Package for performing a mailmerge operation on merge fields within a DOCX document

example/docx_mailmerge_example.dart

import 'dart:io';

import 'package:docx_mailmerge/docx_mailmerge.dart';

void main() {
  //Read a docx file as bytes and pass it to the constrcutor
  final merge = DocxMailMerge(File('test/files/original1.docx').readAsBytesSync());
  //This is just to ensure the output directory exists
  Directory('test/tmp').createSync();
  //Writes the generated merge infomation(bytes) to the output file
  File('test/tmp/example.docx').writeAsBytesSync(merge.merge({'First_Name': 'hello world'}, removeEmpty: false));
}
5
likes
130
pub points
0%
popularity

Publisher

unverified uploader

Package for performing a mailmerge operation on merge fields within a DOCX document

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

archive, shlex, xml

More

Packages that depend on docx_mailmerge