Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-09-2020, 12:59 AM   #1
dxcore35
Member
dxcore35 began at the beginning.
 
Posts: 14
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, 04: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: 55,064
Karma: 51405992
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Sorry, but you cannot do what you want.
JSWolf is offline   Reply With Quote
Old 01-10-2020, 02:25 AM   #3
dxcore35
Member
dxcore35 began at the beginning.
 
Posts: 14
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, 07:12 AM   #4
Doitsu
Wizard
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: 4,757
Karma: 15413559
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, 08:51 AM   #5
dxcore35
Member
dxcore35 began at the beginning.
 
Posts: 14
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, 09:37 AM   #6
Doitsu
Wizard
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: 4,757
Karma: 15413559
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, 01: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,305
Karma: 12696804
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, 03:37 PM   #8
hobnail
Connoisseur
hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.hobnail knows what is on the back of the AURYN.
 
Posts: 69
Karma: 9706
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:33 PM
Problem adding metadata (.opf, .mobi, .azw3) mobilemax Library Management 3 04-27-2016 12:29 PM
Are cover.jpg and metadata.opf files included with Book.azw3 important? omareg94 Amazon Kindle 13 02-11-2015 07:11 AM
Converting ePub > AZW3 so the cover shows up as the first page JSWolf Kindle Formats 5 06-30-2014 02:52 PM
Cover in ADE is first page, and not according to metatag set in content.opf? Klip ePub 4 09-27-2012 08:02 AM


All times are GMT -4. The time now is 07:28 PM.


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