PavelS0 / docx_template_dart

A Docx template engine
Apache License 2.0
43 stars 31 forks source link

FormatException: Could not find End of Central Directory Record #17

Closed Arban960 closed 3 years ago

Arban960 commented 3 years ago

When trying to run the example on , I get FormatException: Could not find End of Central Directory Record. This is the code that I specifically used:

final data = await rootBundle.load('lib\\assets\\template.docx');
        final bytes = data.buffer.asUint8List();

        final docx = await DocxTemplate.fromBytes(bytes);
PavelS0 commented 3 years ago

most likely, the path is not set correctly. Try using unix delimiters instead of windows i.e. 'assets/template.docx'