Question

I've already added an background image to my pdf using :

<fo:simple-page-master master-name="LetterLandscapePortada" page-height="21.59cm" page-width="28.94cm" >
              <fo:region-body margin="0cm" background-repeat="no-repeat" background-image="url(file://D:/XSL/fondoPortada.jpg)" />          
</fo:simple-page-master>

But I'm having problems in order to "auto-fit" the image to the page because the image is larger than the page size.

Does is posible add a property in order to fit the background image to the page?

No correct solution

OTHER TIPS

The spec for xslfo doesn't specify anything for this. See: http://www.w3schools.com/xslfo/obj_region-body.asp

However, there are many ways around this. In xslfo you could add an image before any text is displayed and set its dimensions accordingly, it would then seem to be a 'background' image (with the lowest z-index). A non xsl solution would be to modify the image itself by adding the proper white space/resize in an editor like GIMP and then proceeding as you already do. You can also use the 'position' attributes though they will be of little help if you don't modify the image.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top