mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB Output: Fix default cover page to display correctly In Adobe Digital Editions
This commit is contained in:
parent
a0e7c3bfb4
commit
090b322f8d
@ -108,11 +108,16 @@ class EPUBOutput(OutputFormatPlugin):
|
|||||||
<title>%(title)s</title>
|
<title>%(title)s</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
body {
|
||||||
background: white no-repeat fixed center center;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: center;
|
vertical-align: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
font-size: 18px;
|
font-size: 16pt;
|
||||||
|
}
|
||||||
|
.logo {
|
||||||
|
width: 510px; height: 390px;
|
||||||
|
text-align:center;
|
||||||
|
font-size: 1pt;
|
||||||
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
h1 { font-family: serif; }
|
h1 { font-family: serif; }
|
||||||
h2, h4 { font-family: monospace; }
|
h2, h4 { font-family: monospace; }
|
||||||
@ -120,19 +125,9 @@ class EPUBOutput(OutputFormatPlugin):
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>%(title)s</h1>
|
<h1>%(title)s</h1>
|
||||||
<br/><br/>
|
<img class="logo" src="%(img)s" alt="calibre logo" />
|
||||||
<div style="position:relative">
|
<h2>%(author)s</h2>
|
||||||
<div style="position: absolute; left: 0; top: 0; width:100%%; height:100%%; vertical-align:center">
|
<h4>Produced by %(app)s</h4>
|
||||||
<img src="%(img)s" alt="calibre" style="opacity:0.3"/>
|
|
||||||
</div>
|
|
||||||
<div style="position: absolute; left: 0; top: 0; width:100%%; height:100%%; vertical-align:center">
|
|
||||||
<h2>%(date)s</h2>
|
|
||||||
<br/><br/><br/><br/><br/>
|
|
||||||
<h3>%(author)s</h3>
|
|
||||||
<br/><br/><br/><br/><br/><br/><br/><br/><br/>
|
|
||||||
<h4>Produced by %(app)s</h4>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
'''
|
'''
|
||||||
@ -211,8 +206,9 @@ class EPUBOutput(OutputFormatPlugin):
|
|||||||
'calibre-logo.png')
|
'calibre-logo.png')
|
||||||
self.oeb.manifest.add(id, href, 'image/png', data=img_data)
|
self.oeb.manifest.add(id, href, 'image/png', data=img_data)
|
||||||
title, author = map(prepare_string_for_xml, (title, author))
|
title, author = map(prepare_string_for_xml, (title, author))
|
||||||
|
if not author or not author.strip():
|
||||||
|
author = strftime('%d %b, %Y')
|
||||||
html = self.TITLEPAGE%dict(title=title, author=author,
|
html = self.TITLEPAGE%dict(title=title, author=author,
|
||||||
date=strftime('%d %b, %Y'),
|
|
||||||
app=__appname__ +' '+__version__,
|
app=__appname__ +' '+__version__,
|
||||||
img=href)
|
img=href)
|
||||||
id, href = self.oeb.manifest.generate('calibre-titlepage',
|
id, href = self.oeb.manifest.generate('calibre-titlepage',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user