Mobileread
Automatic cover page - based on metadata from content.opf (EPUB/AZW3)
#1  dxcore35 01-09-2020, 12:59 AM
Hello it is possible to use metadata field from content.opf:

<dc:title>Example</dc:title>
<dc:creator opf:role="aut" opf:file-as="AUTHOR NAME">AUTHOR NAME</dc:creator>
<dc:description>Example text</dc:title>```

And use them in html file?

<body>

<book_title> %(title) </book_title>
<book_autor> %(creator) </book_autor>
<book_desk> %(description) </book_desk>

</body>

How to refer to this metadata?
Reply 

#2  JSWolf 01-09-2020, 04:25 PM
Sorry, but you cannot do what you want.
Reply 

#3  dxcore35 01-10-2020, 02:25 AM
Do you know any details about other solution?
Or can you elaborate why it is not possible?

Thanks a lot!
Reply 

#4  Doitsu 01-10-2020, 07:12 AM
Quote dxcore35
[...] is it possible to use metadata field from content.opf:
Theoretically, it'd possible to parse content.opf with an XMLHttpRequest, however, this would only work with epub3 files and only if the epub app supports Javascript.

Have you tried the Calibre cover generator (Edit metadata > Generate cover)?
Reply 

#5  dxcore35 01-10-2020, 08:51 AM
I was thinking to create fully independent and automatic cover template. Without any external tools. Put simple reference from the metadata file into html... After that simply changing the metadata, the change should be visible in cover as well, because it is using only reference to field from metadata file not "hardcoded" string.
Reply 

#6  Doitsu 01-10-2020, 09:37 AM
Quote dxcore35
I was thinking to create fully independent and automatic cover template. Without any external tools. Put simple reference from the metadata file into html... After that simply changing the metadata, the change should be visible in cover as well, because it is using only reference to field from metadata file not "hardcoded" string.
You can't modify data in (X)HTML files at runtime without JavaScript.
Reply 

#7  DaleDe 01-10-2020, 01:16 PM
Even if you could make it work, metadata is part of the head element, not the body.

Dale
Reply 

#8  hobnail 01-10-2020, 03:37 PM
Not entirely automated but there's the Calibre plugin, Generate Cover:

https://www.mobileread.com/forums/sh...e+cover+plugin

The 3rd tab in its Options window named Contents has a checkbox Custom Text. Now all you need is an easy way to copy the desired metadata so that you can paste it there.
Reply 

Today's Posts | Search this Thread | Login | Register