EpubReader.Cross无效

时间:2017-11-07 10:23:18

标签: xamarin.forms

我正在尝试使用EpubReader.Cross插件来读取epub文件。我正在加载文件,如下所示,我得到以下异常。请建议您解决问题的方法。

FileStream stream = File.Open(mobileFileName, FileMode.Open);
EpubBook epubBook = EpubReader.ReadBook(stream);

异常

System.AggregateException: One or more errors occurred. ---> System.IO.InvalidDataException: End of Central Directory record could not be found.
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory () [0x0002c] in <755caed138d141c5b26f18fea3c29594>:0
at System.IO.Compression.ZipArchive.Init (System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode, System.Boolean leaveOpen) [0x001c8] in <755caed138d141c5b26f18fea3c29594>:0
at System.IO.Compression.ZipArchive..ctor (System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode, System.Boolean leaveOpen, System.Text.Encoding entryNameEncoding) [0x0001c] in <755caed138d141c5b26f18fea3c29594>:0
at System.IO.Compression.ZipArchive..ctor (System.IO.Stream stream) [0x00000] in <755caed138d141c5b26f18fea3c29594>:0
at VersFx.Formats.Text.Epub.EpubReader+d__1.MoveNext () [0x0001f] in :0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at VersFx.Formats.Text.Epub.EpubReader+d__3.MoveNext () [0x00081] in :0

0 个答案:

没有答案