HiraokaHyperTools / PDFsharp

Just xps2pdf
MIT License
18 stars 5 forks source link

"File contains corrupted data." Exception #1

Closed hgmamaci closed 5 years ago

hgmamaci commented 7 years ago

string xpsfilename = @"D:\test\test.xps"; PdfSharp.Xps.XpsConverter.Convert(xpsfilename);

throws

Message File contains corrupted data.

WindowsBase null 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.IO.Packaging.Package.Open(String path)   at PdfSharp.Xps.XpsModel.XpsDocument..ctor(String path)   at PdfSharp.Xps.XpsConverter.Convert(String xpsFilename, String pdfFilename, Int32 docIndex, Boolean createComparisonDocument)   at PdfSharp.Xps.XpsConverter.Convert(String xpsFilename)   at UserQuery.Main()

kenjiuno commented 7 years ago

MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition

The xps file seems to be broken. Could you open it with XPS viewer?

kenjiuno commented 5 years ago

I'll close this issue due to long time inactivity. Please reopen or start new issue, if you still have problem...

wstaelens commented 2 years ago

have seen it also earlier. is there a fix present? (can't find the document again to reproduce 😢 )