1
votes

I am using FOP api with XSL to generate the PDF.

My requirement is to write some text on top of a background image. Any possible way suggested will be helpful.

1
You should provide more details like is the background full page size or just something smaller. Is the position fixed or does it flow?Kevin Brown

1 Answers

2
votes

You can use the background-image property:

<fo:block background-image="image.png">Lorem ipsum.</fo:block>

You can control repetition and position of the image using background-repeat, background-position-horizontal and background-position-vertical:

<fo:block background-image="image.png" background-repeat="no-repeat">Lorem ipsum.</fo:block>

<fo:block background-image="image.png" background-repeat="no-repeat" background-position-horizontal="center">Lorem ipsum.</fo:block>