Hi DJ, In order to use any image as page background (either with fo:external-graphic or fo:instream-foreign-object), you can insert it directly in a static region, using a block-container in absolute position.
With FOP 0.9x, the body region is drawn at the top level, therefore static-regions can be used as background for body region. By setting your background in the start-region, the (0,0) is the top left corner of your sheet, minus fo:simple-page-master margins. In other regions, you can use negative coordinates to put your image else where, depending on extent properties. HTH, Pascal > -----Message d'origine----- > De : Debasish Jana [mailto:[EMAIL PROTECTED] > Envoyé : mercredi 29 août 2007 10:03 > > Hi: > > I need to put a SVG image to appear on every page in > region-body. I would like to create the SVG in the same xsl > file and use it as background image within region-body so as > to appear on every page. Placing the SVG as an external file > works. However, putting the SVG as embedded content does not > work. The XSL code used is given below > > Please help. > > warm regards, > > Debasish Jana > ----- > > Case I (When SVG file is used as external file, this works) > > <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet > version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform "> > > <xsl:template name="PageBG"> > url(E:\DJANA\Test\PageBG.svg) > </xsl:template> > > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> > <fo:layout-master-set> > <fo:simple-page-master master-name="PageMasterPortrait" > page-height="11in" page-width="8.5in" > margin-top="0in" margin-left="0.0in" > margin-right="0.0in" margin-bottom="0.0in" > white-space-collapse="false" > white-space-treatment="preserve" > linefeed-treatment="preserve" line-height="82%" > > > <fo:region-body margin="0.4in" > background-color="#dd0000" > > <xsl:attribute > name="background-image"><xsl:call-template > name="PageBG"/></xsl:attribute> > </fo:region-body> > ..... > > Case II (When SVG content is directly embeded in the xsl > file, this does not work, says background iamge not available) > > > <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet > version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform "> > > <xsl:template name="PageBG"> > <svg xmlns="http://www.w3.org/2000/svg" id="PageBGSVG" > width="7.7in" height="10.2in" viewBox="0 0 0 0"> ..... > > </svg></xsl:template> > > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> > <fo:layout-master-set> > <fo:simple-page-master master-name="PageMasterPortrait" > page-height="11in" page-width="8.5in" > margin-top="0in" margin-left="0.0in" > margin-right="0.0in" margin-bottom="0.0in" > white-space-collapse="false" > white-space-treatment="preserve" > linefeed-treatment="preserve" line-height="82%" > > > <fo:region-body margin="0.4in" > background-color="#dd0000" > > <xsl:attribute > name="background-image"><xsl:call-template > name="PageBG"/></xsl:attribute> > </fo:region-body> > ..... --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]