none
new XpsDocument(string, FileAccess) fails with “File contains corrupted data”, even though the file is not corrupt RRS feed

  • Question

  • Hi,

    doc = new XpsDocument(xpsFile, System.IO.FileAccess.Read);
     docViewer.Document = doc.GetFixedDocumentSequence();

    File contains corrupted data.

    A System.IO.FileFormatException occurred at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition(Stream archiveStream) at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager) at MS.Internal.IO.Zip.ZipArchive..ctor(Stream archiveStream, FileMode mode, FileAccess access, Boolean streaming, Boolean ownStream) at MS.Internal.IO.Zip.ZipArchive.OpenOnFile(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming) at System.IO.Packaging.ZipPackage..ctor(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming) at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare, Boolean streaming) at System.Windows.Xps.Packaging.XpsManager..ctor(String path, FileAccess packageAccess, CompressionOption compressionOption) at System.Windows.Xps.Packaging.XpsDocument..ctor(String path, FileAccess packageAccess

    Can any one help on this 

    Tuesday, October 29, 2019 1:23 PM