OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

odt -> zip -> odt

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
oren222
General User
General User


Joined: 01 May 2006
Posts: 5

PostPosted: Tue May 09, 2006 6:02 am    Post subject: odt -> zip -> odt Reply with quote

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
View user's profile Send private message
Sirmatto
General User
General User


Joined: 01 Aug 2005
Posts: 35

PostPosted: Tue May 09, 2006 6:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Kaaredyret
Moderator
Moderator


Joined: 22 Aug 2003
Posts: 1356
Location: Denmark

PostPosted: Tue May 09, 2006 6:47 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
9point9
Moderator
Moderator


Joined: 31 Aug 2004
Posts: 3875
Location: UK

PostPosted: Tue May 09, 2006 8:36 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Angel Blue01
OOo Advocate
OOo Advocate


Joined: 27 Nov 2005
Posts: 281
Location: Chicago, IL, USA

PostPosted: Tue May 09, 2006 10:02 am    Post subject: Reply with quote

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
View user's profile Send private message
oren222
General User
General User


Joined: 01 May 2006
Posts: 5

PostPosted: Thu May 11, 2006 6:59 am    Post subject: Reply with quote

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
View user's profile Send private message
g10
Newbie
Newbie


Joined: 09 Jun 2006
Posts: 1
Location: Port Hueneme California USA

PostPosted: Fri Jun 09, 2006 7:35 pm    Post subject: odt => zip => odt Reply with quote

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
View user's profile Send private message
9point9
Moderator
Moderator


Joined: 31 Aug 2004
Posts: 3875
Location: UK

PostPosted: Sat Jun 10, 2006 4:09 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3531
Location: Hamburg, Germany

PostPosted: Sat Jun 10, 2006 12:13 pm    Post subject: Re: odt => zip => odt Reply with quote

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
View user's profile Send private message
dagwieers
General User
General User


Joined: 29 Jul 2010
Posts: 14
Location: Belgium

PostPosted: Mon Feb 13, 2012 8:02 am    Post subject: Make sure the mimetype is at the start of the file Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
oshliaer
Newbie
Newbie


Joined: 09 Mar 2012
Posts: 1

PostPosted: Fri Mar 09, 2012 11:27 am    Post subject: Reply with quote

http://www.jejik.com/articles/2010/03/how_to_correctly_create_odf_documents_using_zip/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> General Discussion All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group