#1 2013-05-08 12:16:18

hirnstroem
Member
Registered: 2013-05-08
Posts: 2

Unzip ODF

Hi Forum,

I'd like to unzip ODF Documents created with OOo, LO or AO using TZipRead with BDS 2006. For some files - e.g. the mimetype file - in the container, unzipping works, but not for the XML files - the ones I need.

This is the code I'm using:

with TZipRead.Create(PathAndFileNameOfAnOdfDocument) do
try
  TmpStr := UnZip(NameToIndex('mimetype')); // works
  TmpStr := UnZip(NameToIndex('content.xml')); // "NameToIndex" returns an index >= 0 but "UnZip" leads to error "SynZip -2"
finally
  Free;
end;

The error occurs in "SynZip.pas" (V 1.18) in the "Check" function.

Is it possible to "fix" that? Or am I doing it wrong?

Regards
hirnstroem

Offline

#2 2013-05-08 12:44:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,546
Website

Re: Unzip ODF

This is a Z_STREAM_ERROR kind of error, as returned by the ZLib code.

In which Check() is this returned?

Offline

#3 2013-05-10 05:06:52

hirnstroem
Member
Registered: 2013-05-08
Posts: 2

Re: Unzip ODF

The Check() is called in UnCompressMem() (SynZip.pas line 4512).

As I just found out; unzipping empty document (newly created, no content) works, it's just the ones having content that make trouble.

Offline

Board footer

Powered by FluxBB