xml - XSL-FO Render Has Region-Body at Top of Page. How do I fix? -


i'm assuming region-body should take place after region-before, isn't case once i've transformed pdf.

<fo:root>     <fo:layout-master-set>         <fo:simple-page-master master-name="simplea4" page-height="11in" page-width="8.5in"                                margin-left="0.5cm" margin-right="0.5cm">             <fo:region-body />             <fo:region-before region-name="xsl-region-before" extent="10mm"/>             <fo:region-after region-name="xsl-region-after" extent="3cm"/>         </fo:simple-page-master>     </fo:layout-master-set>     <fo:page-sequence master-reference="simplea4">         <fo:static-content flow-name="xsl-region-before">             <fo:block>               header             </fo:block>         </fo:static-content>         <fo:static-content flow-name="xsl-region-after">           <fo:block>             footer           </fo:block>         </fo:static-content>         <fo:flow flow-name="xsl-region-body">           <fo:block space-after="5mm">                 <fo:table>                     <fo:table-body>                         <fo:table-cell>                             <fo:block>                                 cell 1                             </fo:block>                         </fo:table-cell>                         <fo:table-cell>                             <fo:block />                         </fo:table-cell>                         <fo:table-cell>                             <fo:block />                         </fo:table-cell>                         <fo:table-cell>                             <fo:block />                         </fo:table-cell>                     </fo:table-body>                 </fo:table>             </fo:block>         </fo:flow>     </fo:page-sequence> </fo:root> 

here screenshot of rendered output:

example of rendered output

the region-after working expected.

you have not defined margins body region , page master not have top or bottom margins either. that's why body region flow starts @ top of page. here advice on this:

important: margins set region-body must greater or equal extents of the region-before , region-after (xml.com article)

set top , bottom margins body region:

<fo:region-body margin-top="10mm"  margin-bottom="3cm"/> 

xsl-fo document

<fo:root xmlns:fo="http://www.w3.org/1999/xsl/format">     <fo:layout-master-set>         <fo:simple-page-master master-name="simplea4" page-height="11in" page-width="8.5in"                                margin-left="0.5cm" margin-right="0.5cm">             <fo:region-body   margin-top="10mm"  margin-bottom="3cm"/>             <fo:region-before region-name="xsl-region-before" extent="10mm"/>             <fo:region-after region-name="xsl-region-after" extent="3cm"/>         </fo:simple-page-master>     </fo:layout-master-set>     <fo:page-sequence master-reference="simplea4">         <fo:static-content flow-name="xsl-region-before">             <fo:block>               header             </fo:block>         </fo:static-content>         <fo:static-content flow-name="xsl-region-after">           <fo:block>             footer           </fo:block>         </fo:static-content>         <fo:flow flow-name="xsl-region-body">           <fo:block space-after="5mm">                 <fo:table>                     <fo:table-body>                         <fo:table-cell>                             <fo:block>                                 cell 1                             </fo:block>                         </fo:table-cell>                         <fo:table-cell>                             <fo:block />                         </fo:table-cell>                         <fo:table-cell>                             <fo:block />                         </fo:table-cell>                         <fo:table-cell>                             <fo:block />                         </fo:table-cell>                     </fo:table-body>                 </fo:table>             </fo:block>         </fo:flow>     </fo:page-sequence> </fo:root> 

rendered pdf result (fop)

enter image description here

try solution online here, transformation copies , result can rendered pdf.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -