Absolute Positioning using XSL to be transformed and rendered to PDF

Doug Porter picture Doug Porter · Oct 13, 2008 · Viewed 7.4k times · Source

How does one accomplish absolute positioning using XSL? I am working on a XSL transformation to FO to PDF for mailing letters and am trying to figure out how to absolutely position the fo:blocks containing the Return Address and Recipient Address so that they are displayed in the windows on the envelope.

Anyone have suggestions on the magic syntax to make this happen?

Answer

GerG picture GerG · Oct 14, 2008

I'm not an expert at this and neither do I have (at the moment) an XSL-FO processor here to test this but shouldn't something like this work? (don't take it literally please)

<fo:block>
    <fo:block>
        BLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLA 
    </fo:block>
    <fo:block-container position="absolute" 
                        top="30pt" left="30pt" height="16pt" width="100%">
        <fo:block font="48pt Arial" color="red">absolute</fo:block>
    </fo:block-container>
</fo:block>