Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word file gets corrupted #37

Closed
AbdullahNaveed opened this issue Nov 28, 2022 · 12 comments
Closed

Word file gets corrupted #37

AbdullahNaveed opened this issue Nov 28, 2022 · 12 comments

Comments

@AbdullahNaveed
Copy link

I am trying to edit a very simple word file with 1 control tag.
Word file is fetched correctly and displayed, but when I use docGenerated = await docx.generate(c);

The file gets corrupted. I am using Office 2016 to create word files.

Screen Shot 2022-11-28 at 3 20 49 PM

Code:
Screen Shot 2022-11-28 at 3 21 16 PM

@ShineYang
Copy link

Same problem, it's strange that I've already successfully generated target document fews days before, with the same code.
I tried to downgrade flutter sdk to earlier version (3.5 ~ 3.8) but it doesn't work.

@kungege
Copy link

kungege commented Nov 29, 2022

@PavelS0 Could you take a look at this, please?

@ShineYang
Copy link

@AbdullahNaveed Found a temporary solution here, just override this dependency in pubspec.yaml

dependency_overrides:
  archive: 3.3.0

@AbdullahNaveed
Copy link
Author

@AbdullahNaveed Found a temporary solution here, just override this dependency in pubspec.yaml

dependency_overrides:
  archive: 3.3.0

Works like a charm!!! Thanks so much brother <3

@weimuhua
Copy link

@AbdullahNaveed Found a temporary solution here, just override this dependency in pubspec.yaml

dependency_overrides:
  archive: 3.3.0

you save my life bro!

@marcov-dart
Copy link

As a hint to the maintainers:
I just came across this same problem in a bit of my own code. It worked for archive 3.3.0 but with archive 3.3.5 the resulting zip file is truncated.
I am reading a zip file into Archive and then making a new Archive copying adding of the original ArchiveFile objects but replacing some. Probably very similar to what is being done here.
I had to make new ArchiveFile objects with the name, size and contents of the original (make a copy) and add that copy to the new archive instead of the ArchiveFile objects from the original.

@Terranic
Copy link

Great, thanks!

this one seems to work as well, but with 3.3.3 the docx is becoming corrupted
dependency_overrides: archive: 3.3.2

@WilliansDutra
Copy link

I have the same problem.

I have tried with and without the dependency overrides, tried the code from sample, tried my own template file and template file from docs.

I'm starting to get bald with this lol

image
image
image

@Fiat2U
Copy link

Fiat2U commented Mar 7, 2023

Great, thanks!

this one seems to work as well, but with 3.3.3 the docx is becoming corrupted dependency_overrides: archive: 3.3.2

I used your code in https://github.com/Fiat2U/docx_template_flutter_sample.

@Fiat2U
Copy link

Fiat2U commented Mar 7, 2023

@WilliansDutra
Copy link

@Fiat2U made a test using the link and it worked! Now I'll try within my project. I'll post here the update.

@PavelS0
Copy link
Owner

PavelS0 commented Mar 7, 2023

Probably fixed in de19046

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants