how to get the images of epub book in android

断了今生、忘了曾经 提交于 2019-12-30 11:47:33

问题


i was trying to read the epub book into my android application and succeed withe getting text into my app but not able to load images of epub book. actually what happen when we read the epub book using epub library (it extract/read the epub book and store somewhere in temporary the contents if it store than where the images of epub book is located ?). When i was try to read the image of book it give an error. when i read the content of book it return me HTML page containing the text and image path, but image path is relative like <img src='images/cover.jpg'> so where i get the images.

Thanks in advance


回答1:


The path should be relative to the xhtml file within the archive. That is, if your xhtml file has an image <img src='image/cover.jpg'>, then your image file should be located in a subdirectory relative to the xhtml file called "image".

The .opf file in the .epub is a manifest that should contain a reference to each file within the archive -- including any images. If the image is not referenced there, you might have an invalid epub. The idpf guys maintain an epub validation tool that you can download here: Google code.



来源:https://stackoverflow.com/questions/7510721/how-to-get-the-images-of-epub-book-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!