Adding two background-images on my frontpage
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
Adding two background-images on my frontpage
Hi there!
I'm trying to add two different background-images on my frontpage:
But it doesn't work, only the first image (bandeau.png) is displayed.
I tried to change the order and add the first, but the same problem occurs, I only get one of the two images (the first declared in the background-image element).
I also tried to make both images kind of small, as I thought they were maybe overlapping, but no.
To sum up, what I'm trying to do is :
Best regards,
Romane
I'm trying to add two different background-images on my frontpage:
- One that is common for every document and that never changes.
- One that changes for every document and that is defined in the bookmap using:
Code: Select all
<prodinfo> <prodname>TopSolid'Cam<data name="background" value="images/bg_image.jpg" format="jpg"/></prodname> </prodinfo>
Code: Select all
@page front-page {
background-image: url("images/bandeau.png"), url(oxy_xpath("//*[contains(@class, 'bookmap/bookmeta')]//*[contains(@class, 'topic/data')][@name='background']/@value"));
background-repeat: no-repeat, no-repeat;
background-position: 0cm 16.5cm, 0cm 0cm;
background-size: 100%, 20%;
}
I tried to change the order and add the
Code: Select all
url(oxy_xpath("//*[contains(@class, 'bookmap/bookmeta')]//*[contains(@class, 'topic/data')][@name='background']/@value"));
I also tried to make both images kind of small, as I thought they were maybe overlapping, but no.
To sum up, what I'm trying to do is :
- A footer that never changes
- An image that takes 2/3 of my front page
- Ideally a logo that will be in the header
Best regards,
Romane
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Adding two background-images on my frontpage
Post by julien_lacour »
Hi Romane,
Currently Chemistry doesn't support having two values for background-image property.
Instead you can use a CSS looking like the following one:
I also attach some useful links that will help you understanding what I gave you above:
https://www.oxygenxml.com/doc/versions/ ... over_image
https://www.oxygenxml.com/doc/versions/ ... the_header
Of course you can still use the oxy_xpath("//*[contains(@class, 'bookmap/bookmeta')]//*[contains(@class, 'topic/data')][@name='background']/@value") query as the property value, this is totally valid.
You may need to fine tune your images and/or the background-position percentages, but what I gave you should work.
Regards,
Julien
Currently Chemistry doesn't support having two values for background-image property.
Instead you can use a CSS looking like the following one:
Code: Select all
@page front-page {
background-image: url("cover.png");
background-position: center;
background-repeat: no-repeat;
background-size: 100% 100%;
@top-left {
content: " ";
background-image: url("logo.png");
background-repeat: no-repeat;
background-position: 50% 50%;
background-color: black;
}
@top-center {
content: " ";
}
@top-right {
content: " ";
}
@bottom-left {
content: " ";
background-image: url("footer.png");
background-repeat: no-repeat;
background-position: 50% 50%;
}
}
https://www.oxygenxml.com/doc/versions/ ... over_image
https://www.oxygenxml.com/doc/versions/ ... the_header
Of course you can still use the oxy_xpath("//*[contains(@class, 'bookmap/bookmeta')]//*[contains(@class, 'topic/data')][@name='background']/@value") query as the property value, this is totally valid.
You may need to fine tune your images and/or the background-position percentages, but what I gave you should work.
Regards,
Julien
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