开发者

EPUB file generation, cover page

开发者 https://www.devze.com 2023-03-23 00:25 出处:网络
I am generating epub book file, and im stuck with a problem. It doesn\'t read my cover. Here\'s the cover.xhtml Am I doing something wrong? IMB documentation over the epub creation tells that the only

I am generating epub book file, and im stuck with a problem. It doesn't read my cover. Here's the cover.xhtml Am I doing something wrong? IMB documentation over the epub creation tells that the only one I need is cover.html file and a images folder with a image in my /OPS folder.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cover</title>
<style type="text/css"> img { max-width: 100%; } </styl开发者_StackOverflowe>
</head>
<body>
<div id="cover-image">
<img src="/images/cover.jpg" alt="Title"/>
</div>
</body>
</html>


The problem is as likely to be in your package file as it is in this file. However, there is one definite problem with this xhtml file. The URL to the image itself needs to be relative. All paths/urls in an EPUB are relative. Assuming that your images are in subdirectory of the directory containing the xhtml files, then you need to have a img element like:

<img src="images/cover.jpg alt="Title"/>

EDIT (Extraneon added comment by author to answer)

It's always worth using the epubcheck utility when you have problems. I added the xhtml you used to one of my EPUBs and epubcheck reported the problem,

0

精彩评论

暂无评论...
验证码 换一张
取 消