I’m trying to overlay a watermark over text by placing the watermark in 
<fo:region-after> as per the FOP documentation in 
https://xmlgraphics.apache.org/fop/0.95/output.html. But the watermark is 
always rendered under the text. How can I get the watermark to overlay over the 
text?

Here’s the code snippet:

<?xml version="1.0"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
    <fo:layout-master-set>
        <fo:simple-page-master
            master-name="A4" margin-top="1.5cm" margin-bottom="1.5cm"
            margin-left="1.25cm" margin-right="1cm">  
            <fo:region-body />              
            <fo:region-after extent="11in"/>        
        </fo:simple-page-master>
    </fo:layout-master-set>

       <fo:page-sequence master-reference="A4">
        <fo:static-content flow-name="xsl-region-after">
            <fo:block-container position="absolute" top="80px" left="0px">
               <fo:block display-align="center" font-weight="bold" 
font-size="40pt" color="red”>Watermark
               </fo:block>
             </fo:block-container>
       </fo:static-content>    
       
        <fo:flow flow-name="xsl-region-body" font-size="20pt">
        <fo:block-container>
            <fo:block margin-top="0px">This text should appear under the 
watermark   
            </fo:block>
            </fo:block-container> 
            </fo:flow>
       </fo:page-sequence>

Thanks,
Puja

Reply via email to