user2498307
user2498307

Reputation: 11

Text with a background image with FOP

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.

Upvotes: 1

Views: 6158

Answers (1)

lfurini
lfurini

Reputation: 3788

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>

Upvotes: 3

Related Questions