| View previous topic :: View next topic |
| Author |
Message |
oren222 General User

Joined: 01 May 2006 Posts: 5
|
Posted: Tue May 09, 2006 6:02 am Post subject: odt -> zip -> odt |
|
|
Hi all,
I am trying to create an odt file manually (not with open office). I tried the following:
1. I created an original odt file (test.odt) in openoffice (so I will have a "template").
2. Then I took this file and rename it as a zip file (test.zip).
3. I uncompressed the zip file to a folder.
4. I made a minor change to the content.xml
5. I zipped it (using winzip 10)
6. Renamed it back to test.odt
Unfortunately, I was unable to open the new test.odt file I got. It didn't work even if I skipped step 4 (meaning I didn't change anything in the file).
Could someone please help me to understand what do I do wrong?
I think somehow when I zip it with the winzip it uses different compression than the openoffice uses and that's why it doesn't recognize the file.
thanx for you help,
Oren |
|
| Back to top |
|
 |
Sirmatto General User

Joined: 01 Aug 2005 Posts: 35
|
Posted: Tue May 09, 2006 6:44 am Post subject: |
|
|
| I'm pretty sure WinZip 10 uses a new, convoluted compression algorithm by default. See if there's a way to use the original zip algorithm when you compress it. But WinZip isn't that great to begin with. I'd recommend either WinRAR or 7-Zip (my personal favorite AND open source). |
|
| Back to top |
|
 |
Kaaredyret Moderator


Joined: 22 Aug 2003 Posts: 1356 Location: Denmark
|
Posted: Tue May 09, 2006 6:47 am Post subject: |
|
|
I think WinZip 10 introduced a new ZIP algorithm that is not totally compatible with old zip formats. Try using some other program, or look in WinZips options if there is a classic mode, compatibility mode, whatever. _________________ www.kaaredyret.dk - OpenOffice resources (templates, extensions, tutorials and more) !
Stay updated on software and OpenOffice.org news via Twitter |
|
| Back to top |
|
 |
9point9 Moderator

Joined: 31 Aug 2004 Posts: 3875 Location: UK
|
Posted: Tue May 09, 2006 8:36 am Post subject: |
|
|
Winzip does use it's own Winzip 10 format sometimes. You can get it to do a proper ZIP file too, you just have to set the compression method before hand. I'd agree with others on using 7-zip. So far I haven't found anything that can ZIP smaller than it.
Winzip 10's new format often gives a smaller file size but is not as good as the 7z format that 7-zip supports.
In my experience, it is best when extracting, modifying and compressing OpenDocument files to script it. Manually doing it takes so much longer. How you can script it does depend upon your OS and what compression programs you are using. A command line version of 7-zip, p7zip is available. _________________ Arch Linux
OOo 3.2.0
OOoSVN, change control for OOo documents:
http://sourceforge.net/projects/ooosvn/ |
|
| Back to top |
|
 |
Angel Blue01 OOo Advocate

Joined: 27 Nov 2005 Posts: 281 Location: Chicago, IL, USA
|
Posted: Tue May 09, 2006 10:02 am Post subject: |
|
|
WinZip 10 does have its own format but its not selected by default if you use the add file command. _________________ People I know using OpenOffice.org: 6 not counting myself |
|
| Back to top |
|
 |
oren222 General User

Joined: 01 May 2006 Posts: 5
|
Posted: Thu May 11, 2006 6:59 am Post subject: |
|
|
Thanks for your help guys.
Actually my problem was that I compressed the whole folder and not only the content of it so the path was wrong.
I was trying to do it from my MFC project. So I looked for classes that I can use to zip files.
The classes I found keep the whole path in the zip file so let's say I did the following:
1. I created test.odt file with OpenOffice.
2. I renamed it to test.zip and uncompressed it to c:\test\
3. I zip it again with a zip class I got from Codeproject.com
The result is a zip file that contains the files in test folder in the zip file. Somehow it keeps the full path. I need of course the files that in the folder test to be in the zip. Does anyone have experience with a zip class and can help me with that?
Thanks in advance,
Oren |
|
| Back to top |
|
 |
g10 Newbie

Joined: 09 Jun 2006 Posts: 1 Location: Port Hueneme California USA
|
Posted: Fri Jun 09, 2006 7:35 pm Post subject: odt => zip => odt |
|
|
I'm also having trouble re-zipping.
I create a simple "Hello world" file.
Unzip it. Make NO change. Re-zip (with 7-Zip).
When attempting to open, Writer asks for character encoding.
Most answers I supply produce seemingly random characters, blank pages, or cause a crash.
Questions:
Why would it even be asking, isn't the encoding carried somewhere in the pakage?
What is the default decoding? |
|
| Back to top |
|
 |
9point9 Moderator

Joined: 31 Aug 2004 Posts: 3875 Location: UK
|
Posted: Sat Jun 10, 2006 4:09 am Post subject: |
|
|
You wouldn't seem to have a standard ZIP file if it's doing that. Make sure it is a ZIP file, not 7z. _________________ Arch Linux
OOo 3.2.0
OOoSVN, change control for OOo documents:
http://sourceforge.net/projects/ooosvn/ |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3531 Location: Hamburg, Germany
|
Posted: Sat Jun 10, 2006 12:13 pm Post subject: Re: odt => zip => odt |
|
|
| g10 wrote: | I create a simple "Hello world" file.
Unzip it. Make NO change. Re-zip (with 7-Zip). |
Did you unzip the files in a new folder? If so, did you re-zip the files in the new folder or did you re-zip the new folder? You should always re-zip the files (content.xml etc).
Did you try to re-unzip? Did that folder or files look exactly as the previous unzip files?
With kind regards
hol.sten |
|
| Back to top |
|
 |
dagwieers General User


Joined: 29 Jul 2010 Posts: 14 Location: Belgium
|
Posted: Mon Feb 13, 2012 8:02 am Post subject: Make sure the mimetype is at the start of the file |
|
|
You have to make sure when creating your ZIP file, that the mimetype file is the very first file of your archive (and that it is added uncompressed, which would be ok since it's too small to be compressed anyway).
On Linux you can verify that you did it correctly, by using the file command on your newly created ZIP file. |
|
| Back to top |
|
 |
oshliaer Newbie

Joined: 09 Mar 2012 Posts: 1
|
|
| Back to top |
|
 |
|