How does Open Office compress its files?

前端 未结 4 1285
一向
一向 2020-12-29 10:45

I\'m trying to create an Open Office spreadsheet programmatically but for some reason simply compressing a folder with all the necessary files makes Open Office flag the fil

4条回答
  •  难免孤独
    2020-12-29 11:44

    Documentation here. This steps worked for me:

    1. Uncompress the original document file (it's a normal zip file) to some directory:

      $ mkdir document
      $ cd document
      $ unzip ../document.odt
      
    2. Modify the uncompressed data.

    3. Create a new odt:

      $ zip -0 -X ../document2.odt mimetype
      $ zip -r ../document2.odt * -x mimetype
      

提交回复
热议问题