如何让EPUB书籍在Android上的图像 [英] how to get the images of epub book in android

查看:138
本文介绍了如何让EPUB书籍在Android上的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图阅读EPUB书籍到我的Andr​​oid应用程序,并成功枝条获取文本到我的应用程序,但无法加载EPUB书的图像。其实,当我们读取使用EPUB库EPUB书籍怎样就怎样(解压/阅读EPUB书籍和临时存储一些内容,如果它不是在那里EPUB书的图片位于存储?)。当我尝试阅读本书的形象就给出一个错误。 当我读这本书的内容是返回我包含文本和图像路径的HTML页面,但图片路径是相对的,比如< IMG SRC =图像/ cover.jpg'> 那么,我得到的图像。

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.

在此先感谢

推荐答案

路径应该是相对于存档中的XHTML文件。也就是说,如果你的XHTML文件有一个图像&LT; IMG SRC =图像/ cover.jpg'&GT; ,那么你的图像文件应设在一个子目录相对于所谓的形象。

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".

在.epub的.opf文件是应包含在归档中引用的每个文件清单 - 包括所有图像。如果图像不被引用在那里,你可能有一个无效的EPUB。该IDPF家伙保持EPUB验证工具,您可以在这里下载:谷歌code

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.

这篇关于如何让EPUB书籍在Android上的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆