You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Regina Henschel <rb...@t-online.de> on 2013/03/27 23:21:11 UTC

How to get mimetype at first position in the zip-container?

Hi all,

when I open a .odp file with 7z, I can edit the content.xml with an 
editor. The file is then updated inside the zip-container. But 7z orders 
the files and folders alphabetically and therefore the file mimetype is 
no longer at first position.

I have already tried to add the files and folders one by one. But 7z 
does not keep the order in which the files are added to the container, 
but still sort them alphabetically.

Apache OpenOffice itself is tolerant and opens the file nevertheless. 
But the file is not valid. I cannot use AOO to save the file, which 
would bring the parts in the correct order, because AOO alters the 
content when saving and my changes are lost.

Does anyone know, how I can pack the parts, so that it will be a valid 
ODF zip-container?

Kind regards
Regina

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: How to get mimetype at first position in the zip-container?

Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hi Regina,

On Wed, Mar 27, 2013 at 11:21:11PM +0100, Regina Henschel wrote:
> Hi all,
> 
> when I open a .odp file with 7z, I can edit the content.xml with an
> editor. The file is then updated inside the zip-container. But 7z
> orders the files and folders alphabetically and therefore the file
> mimetype is no longer at first position.
> 
> I have already tried to add the files and folders one by one. But 7z
> does not keep the order in which the files are added to the
> container, but still sort them alphabetically.
> 
> Apache OpenOffice itself is tolerant and opens the file
> nevertheless. But the file is not valid. I cannot use AOO to save
> the file, which would bring the parts in the correct order, because
> AOO alters the content when saving and my changes are lost.
> 
> Does anyone know, how I can pack the parts, so that it will be a
> valid ODF zip-container?

Didn't you try zip/unzip?
All of the following should be available in your cygwin:

only take the content.xml out of the ODF file:
]$ unzip demo.odg content.xml
Archive:  demo.odg
  inflating: content.xml 

indent it, to make it more readable:
]$ xmlindent -w content.xml

edit it (vim has syntax highlighting):
]$ vim content.xml

put the modified content.xml back:
]$ zip demo.odg content.xml
updating: content.xml
(deflated 84%)


If you get a warning like this:
        zip warning: Local Entry CRC does not match CD: content.xml
It's just a warning, the file can be opened safely (nevertheless, best
back up it before playing with all this) vid.
http://softsolder.com/2010/07/25/


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: How to get mimetype at first position in the zip-container?

Posted by Andrew Douglas Pitonyak <an...@pitonyak.org>.
thanks for the update on this....



On 03/27/2013 06:35 PM, Regina Henschel wrote:
> Hi all,
>
> OK, I found a solution: I first generate a zip-container with the 
> command line version of 7z, which contains only the file mimetype. The 
> command line version of 7z can do this without compressing the file. 
> And in the second step I use Windows7 itself and simple drag the files 
> and folders to that zip-container. Windows7 treats zip-container 
> nearly like folders.
>
> Kind regards
> Regina

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: How to get mimetype at first position in the zip-container?

Posted by Regina Henschel <rb...@t-online.de>.
Hi all,

OK, I found a solution: I first generate a zip-container with the 
command line version of 7z, which contains only the file mimetype. The 
command line version of 7z can do this without compressing the file. And 
in the second step I use Windows7 itself and simple drag the files and 
folders to that zip-container. Windows7 treats zip-container nearly like 
folders.

Kind regards
Regina



Regina Henschel schrieb:
> Hi all,
>
> when I open a .odp file with 7z, I can edit the content.xml with an
> editor. The file is then updated inside the zip-container. But 7z orders
> the files and folders alphabetically and therefore the file mimetype is
> no longer at first position.
>
> I have already tried to add the files and folders one by one. But 7z
> does not keep the order in which the files are added to the container,
> but still sort them alphabetically.
>
> Apache OpenOffice itself is tolerant and opens the file nevertheless.
> But the file is not valid. I cannot use AOO to save the file, which
> would bring the parts in the correct order, because AOO alters the
> content when saving and my changes are lost.
>
> Does anyone know, how I can pack the parts, so that it will be a valid
> ODF zip-container?
>
> Kind regards
> Regina
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org