How to zip a WordprocessingML folder into readable docx

末鹿安然 提交于 2019-11-28 16:51:24

The most common problem around manually zipping together Open XML documents is that it will not work if you zip the directory instead of the contents. In other words, the[content_types].xml file, and the word, docProps, and _rels directories need to reside at the root level of the zip file.

Here are steps to unzip my.docx and re-zip:

% mkdir unzipped
% cd unzipped/
% unzip ../my.docx    
% zip -r ../rezipped.docx *
% open ../rezipped.docx 

Further to what Mica said, the contents of the ZIP file are organised according to the Open Packaging Convention; cf. Microsoft's Essentials of the Open Packaging Convention.

You can use the .NET System.IO.Packaging to make and manipulate .docx files; this class is implemented in the Mono project.

The compression algorithm used is "Zip" (Base 64) compression.

7zip seems to offer this, though i have no tested it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!