[英]How to parse an ncx file using c#
I am trying to create a windows phone app for reading e-pubs. 我正在尝试创建Windows Phone应用来阅读电子酒吧。 I extracted the content and now I want to read the ncx file.
我提取了内容,现在我想读取ncx文件。 But when I try to use System.Xml.Serialization.XmlSerializer it is telling me unknown field in the second line itself.
但是,当我尝试使用System.Xml.Serialization.XmlSerializer时,它告诉我第二行本身中的未知字段。 Please help
请帮忙
Here is how the basic approach to read an epub file 这是读取epub文件的基本方法
Problems you are likely to encounter: 您可能会遇到的问题:
Many EPUB books are created using ZIP-generators that, although compatible with the ZIP standard, are incompatible with the ZIP-reader APIs built into the OS. 许多EPUB图书都是使用ZIP生成器创建的,尽管它们与ZIP标准兼容,但与操作系统内置的ZIP阅读器API不兼容。 You will probably need to use a third party library like DotNetZip or SharpZipLib (but be careful of the licence conditions for the latter).
您可能需要使用第三方库,例如DotNetZip或SharpZipLib(但要注意后者的许可条件)。
You will need to do some work to display images in the WebView, especially if you try to cover all the image types that are part of the EPUB standard. 您将需要做一些工作才能在WebView中显示图像,尤其是当您尝试覆盖EPUB标准中的所有图像类型时。
It will be fiddly to find and apply all the CSS styles that the EPUB book defines. 找到并应用EPUB书中定义的所有CSS样式将是一件轻而易举的事情。
You will probably want to display a 'paged' view of the chapter, rather than displaying it as a long vertically scrollable column. 您可能需要显示章节的“分页”视图,而不是将其显示为垂直可滚动的长列。 That will involve some funky javascript work.
那将涉及一些时髦的JavaScript工作。
You may find that an individual EPUB chapter is too large for displaying in a WebView. 您可能会发现单个EPUB章节太大而无法在WebView中显示。 In the end, you may decide that all the limitations of WebView mean you will be better off writing your own custom XHTML-parsing rendering solution, and displaying using TextBlocks, or something more exotic (you can use C++ interop code and the D2D Font APIs)
最后,您可能会认为WebView的所有局限性意味着最好编写自己的自定义XHTML解析呈现解决方案,并使用TextBlocks或其他更奇特的方式进行显示(可以使用C ++互操作代码和D2D Font API )
To parse .epub file you may want to use a library : 要解析.epub文件,您可能需要使用一个库:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.