Page 1 of 1

"ZLib decompress error" loading document that contains image(s)

Posted: Mon Aug 21, 2023 7:41 am
by Ash
Hello!
I'm facing an issue with the DOCXReadWriteVcl component in Delphi2010.
Loading a docx file that contains an image and has been previously saved using TDOCXReadWriteVcl will result in a "ZLib decompress error".
Both the original and new document can be opened using MS Word and they look identical - however the new document is slightly smaller in size.

Code: Select all

original.LoadFromFile('original.docx'); //Contains image, 291KB size
original.SaveToFile('new.docx'); //Copy, 284KB size

new.LoadFromFile('new.docx'); //ZLib decompress error
Tested with JPEGs, PNGs and BMPs - same result each time.
If the document does not contain an image it works just fine and I am able to edit the text, insert page breaks, save and load multiple times, etc.

Is there any way to disable compression in the first place or fix the issue some other way?

Best regards,
Ash