Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-08-2020, 11:59 PM   #1
dxcore35
Member
dxcore35 began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2018
Device: Kindle Voyage
Automatic cover page - based on metadata from content.opf (EPUB/AZW3)

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?
dxcore35 is offline   Reply With Quote
Old 01-09-2020, 03:25 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Sorry, but you cannot do what you want.
JSWolf is offline   Reply With Quote
Old 01-10-2020, 01:25 AM   #3
dxcore35
Member
dxcore35 began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2018
Device: Kindle Voyage
Do you know any details about other solution?
Or can you elaborate why it is not possible?

Thanks a lot!
dxcore35 is offline   Reply With Quote
Old 01-10-2020, 06:12 AM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by dxcore35 View Post
[...] 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)?
Doitsu is offline   Reply With Quote
Old 01-10-2020, 07:51 AM   #5
dxcore35
Member
dxcore35 began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2018
Device: Kindle Voyage
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.
dxcore35 is offline   Reply With Quote
Old 01-10-2020, 08:37 AM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by dxcore35 View Post
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.
Doitsu is offline   Reply With Quote
Old 01-10-2020, 12:16 PM   #7
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Even if you could make it work, metadata is part of the head element, not the body.

Dale
DaleDe is offline   Reply With Quote
Old 01-10-2020, 02:37 PM   #8
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
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.
hobnail is offline   Reply With Quote
Reply

Tags
azw3, epub, html, metadata


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
having metadata.opf, cover.jpg + title.[pdf|epub|..] what's the best function to use? kabirmaar Development 2 06-21-2017 03:33 PM
Problem adding metadata (.opf, .mobi, .azw3) mobilemax Library Management 3 04-27-2016 11:29 AM
Are cover.jpg and metadata.opf files included with Book.azw3 important? omareg94 Amazon Kindle 13 02-11-2015 06:11 AM
Converting ePub > AZW3 so the cover shows up as the first page JSWolf Kindle Formats 5 06-30-2014 01:52 PM
Cover in ADE is first page, and not according to metatag set in content.opf? Klip ePub 4 09-27-2012 07:02 AM


All times are GMT -4. The time now is 06:22 PM.


MobileRead.com is a privately owned, operated and funded community.