Changing the front page image according to the bookmeta
Posted: Tue Jun 29, 2021 4:25 pm
Hi all!
I'm trying to customize my PDF (based on HTML5 & CSS) in order to display a certain background image on my front page according to some metadata from my bookmap. What I'm trying to do is the exact same thing as explained here: topic22276.html and I already tried the code used in this topic but it doesn't seem to work for me.
This is what I have in my bookmap:
And this is what I added to my CSS file:
I assumed it was not working because the oxy_xpath wasn't precise enough so I also tried this:
But it wasn't working either.
Do you have any idea why it's not working? Is it because my image is a .png and not a .svg?
Thank you very much,
Romane
I'm trying to customize my PDF (based on HTML5 & CSS) in order to display a certain background image on my front page according to some metadata from my bookmap. What I'm trying to do is the exact same thing as explained here: topic22276.html and I already tried the code used in this topic but it doesn't seem to work for me.
This is what I have in my bookmap:
Code: Select all
<bookmeta>
<prodinfo>
<prodname>MyProduct<data name="background" value="bgr_right.png"/></prodname>
</prodinfo>
</bookmeta>
Code: Select all
@page front-page {
background-image: url(oxy_xpath("//*[contains(@class, ' topic/data')][@name='background'][1]/@value"));
}
Code: Select all
@page front-page {
background-image: urloxy_xpath('//*[contains(@class, " bookmap/bookmeta ")]/*[contains(@class, ' topic/data')][@name='background'][1]/@value"));
}
Do you have any idea why it's not working? Is it because my image is a .png and not a .svg?
Thank you very much,
Romane