Forum How do I...?

Can PrinceXML do this?

yet
- having a background image on each page where the background image covers the whole page?

- have repeating elements like an image or a box with text appearing on each page (within the page body - not at the predefined regions like top, bottom, left or right border)?

- some kind of absolute positioning for text (make this text appear e.g. 20cm from the top)?

Andreas
oliof
Nota Bene: I am just a PrinceXML user, take these answers with a grain of salt.

- having a background image on each page where the background image covers the whole page?


Yes. You can define a background-image for pages. Be aware that prince will embed the background-image for every single page, which makes for huge PDFs.

- have repeating elements like an image or a box with text appearing on each page (within the page body - not at the predefined regions like top, bottom, left or right border)?


Not sure what you want to achieve here. Maybe a bit of detail helps?

- some kind of absolute positioning for text (make this text appear e.g. 20cm from the top)?


Yes, within the capabilities of css, you can also position elements absolutely.
mikeday
Yes. You can define a background-image for pages. Be aware that prince will embed the background-image for every single page, which makes for huge PDFs.

This should only occur for SVG background images, not bitmap background images (eg. PNG, JPEG). We hope to fix this issue in the future.
yet
oliof wrote:
Nota Bene: I am just a PrinceXML user, take these answers with a grain of salt.

- having a background image on each page where the background image covers the whole page?


Yes. You can define a background-image for pages. Be aware that prince will embed the background-image for every single page, which makes for huge PDFs.


Assume you have the following HTML:

<html>
<head>
<style type="text/css">
.body { background: url("test1.png");
background-position: center;
width: 100%;
height: 100%;
page-break-after: always;
color: white;
columns: 2;
}

</style>
</head>
<body>

<div class="body">
hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world
.....
</div>
</body>
</html>

test1.png is a high-resolution image with the same ratio as the page.
The text spawns fully over the first page and half of the second page.
On the first page the image is fully shown and covers the main content area. On the second page the image is clipped to the size of the textarea. How can I make the image also shown fully (filling the whole main content slot)?
mikeday
Place the background image on the page instead:
@page { background: url("test1.png") }

Or in HTML you can also place it on the <body> element.
fdelaneau
How can I place a SVG background like mentioned above ?

If the SVG is placed like this will it run under the page margin (under the @bottom).

Lastly can the SVG be modified with CSS (to change the color).