问题
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