Changing the front page image according to the bookmeta
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
-
- Posts: 4
- Joined: Tue Jun 29, 2021 4:13 pm
Changing the front page image according to the bookmeta
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
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Changing the front page image according to the bookmeta
Post by julien_lacour »
Hello Romane,
You were really close of the solution, here is the correct CSS:
The 'topic/data' element is a descendant of the 'bookmap/bookmeta', the "/*" XPath rule matches only a node direct children.
Regards,
Julien
You were really close of the solution, here is the correct CSS:
Code: Select all
@page front-page {
background-image: url(oxy_xpath("//*[contains(@class, 'bookmap/bookmeta')]//*[contains(@class, ' topic/data')][@name='background'][1]/@value"));
}
Regards,
Julien
-
- Posts: 4
- Joined: Tue Jun 29, 2021 4:13 pm
Re: Changing the front page image according to the bookmeta
Hi again,
I solved the problem.
Actually it was not working on my computer (oXygen 20.1) but when tried on another computer with oXygen 23.1, it worked!
I then tried to import the CSS folder back to my computer and I was still not working. So I guess it was just a version problem.
Regards,
Romane
I solved the problem.
Actually it was not working on my computer (oXygen 20.1) but when tried on another computer with oXygen 23.1, it worked!
I then tried to import the CSS folder back to my computer and I was still not working. So I guess it was just a version problem.
Regards,
Romane
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service