Re-pack xps extraction to zip again

538 views Asked by At

I extracted an xps to a folder, edit some images and i want to rezip it in order to keep it openable with the XPS viewer, but there is something wrong!.. either if i dont change anything, i cant rezip it an open it with the XPS viewer.

I am using windows "send to compress folder" and WinZip with "No compression | Super Fast | Enh. Deflate" and ICSharpCode.SharpZipLib.dll. But no Success.

Please Help!

2

There are 2 answers

1
mloar On

This usually means you've ended up zipping the enclosing folder.

Navigate to the folder containing "[Content Types].xml", press Ctrl+A to select all items, right-click and select Send To Compressed Folder, and rename the resulting .zip to .xps.

0
Ed Bayiates On

You need to use the VSTO power tools for Visual Studio to edit and repack XPS files. Using any ZIP program won't work because Microsoft does something non-standard in the ZIP headers that causes XPS viewers not to recognize the XPS if you ZIP it yourself.

VSTO power tools