2018.1

Table Of Contents
Print section background selector
When you inspect a Print section in a browser, you will see that it has a <div id="pages">
element as the first child of the <body> element. Inside this <div> there are one or more
MediaBoxes: elements with the class page_mediabox. Each MediaBox contains the Media,
section background and Master Page that apply to one page (see "Media" on page408,
"Master Pages" on page404 and "Using a PDF file as background image" on page393).
In the MediaBox, a Print section background is an <img> element with the ol_pdf_datamapper_
input class. Its src attribute references the PDF file that contains the image and its page
attribute is used to select a specific page in that PDF (as a PDF can contain more than one
page). For example:
<img src="file:/C:/Users/MyUser/Pictures/mixed.pdf?page=1" class="ol_pdf_datamapper_
input">.
You can use the ol_pdf_datamapper_input class as a selector to target the section background
in a style rule or script.
Placing the section background in front of the Master Page
The stacking order of elements inside each MediaBox, from bottom to top, is:
1. Media
2. Section background
3. Master Page elements
Using the .page_mediabox selector, you could change this stacking order and place the section
background on top of the elements on the Master Page. Set the z-index property to a value
larger than 0 (zero) and add !important to make this style rule override the inline style
declaration that normally puts the section background behind the Master Page elements:
.page_mediabox img.ol_pdf_datamapper_input {
z-index: 10 !important;
}
Scaling the section background
The rule below downscales the section background image and keeps it in the centre of the
page:
.page_mediabox img.ol_pdf_datamapper_input {
transform: translate(-50%, -50%) scale(1.5, 1.5) !important;
}
Page 729