Hi all,
i have a problem in page layout when i print my pdf file,
i'm using Fop 0.20.3 my case as following :-
i want to create a page which its content has a distance of 1.6 cm from borders.
i make all setting as i know and imagine that everything must work fine with this adjustment
but when i print it i found distance is 2.1 cm instead of 1.6 cm my code is like this :
hope that anyone help me to adjust page layout
 
<?xml version="1.0"?>
 
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format"
  xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java">
 
  <xsl:template match="goodorder">
   <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 
    <fo:layout-master-set>
     <fo:simple-page-master master-name="page"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1.6cm"
                  margin-bottom="1cm"
                  margin-left="1.6cm"
                  margin-right="1.6cm">
 
       <fo:region-body display-align="after"/>
     </fo:simple-page-master>
 
     <fo:page-sequence-master master-name="all">
       <fo:repeatable-page-master-alternatives>
         <fo:conditional-page-master-reference master-reference="page" page-position="first"/>
       </fo:repeatable-page-master-alternatives>
     </fo:page-sequence-master>
    </fo:layout-master-set>
 
    <fo:page-sequence master-reference="all">
      <fo:flow flow-name="xsl-region-body">
 
                       <xsl:call-template name="title"/>
                       <xsl:call-template name="customer-info"/>
                       <xsl:call-template name="contents"/>
      </fo:flow>
    </fo:page-sequence>
   </fo:root>
  </xsl:template>
 
    <xsl:template name="title">
        <!-- =================== Start Title ==================== -->
        <fo:table table-layout="fixed">
            <fo:table-column column-width="1.8cm"/>
            <fo:table-column column-width="13.9cm"/>
            <fo:table-column column-width="2.1cm"/>
            <fo:table-body >
            <fo:table-row >
            <fo:table-cell/>
            <fo:table-cell>
                    <fo:block font-size="20pt" text-align="left" font-weight="bold" display-align="before">
                        Company Name
                    </fo:block>
            </fo:table-cell>
                <fo:table-cell >
                  <fo:block text-align="end" >Logo</fo:block>
                </fo:table-cell >
            </fo:table-row>
              <fo:table-row font-size="10pt" height="5mm"><fo:table-cell number-columns-spanned="3"></fo:table-cell ></fo:table-row >
            </fo:table-body >
        </fo:table>
      <!-- =================== End Title ==================== -->
      </xsl:template>
      <!-- ============= Customer Info ============= -->
<xsl:template name="customer-info">
   <fo:table table-layout="fixed">
      <fo:table-column column-width="2.1cm"/>
      <fo:table-column column-width="11.0cm"/>
      <fo:table-column column-width="4.7cm"/>
      <fo:table-body >
      <fo:table-row font-size="10pt" height="5mm"><fo:table-cell number-columns-spanned="3"></fo:table-cell ></fo:table-row >
      </fo:table-body>
      </fo:table>
        </xsl:template>
           <!--======================== ( Content ) ========================-->
        <xsl:template name="contents">
        <fo:table table-layout="fixed">
            <fo:table-column column-width="2.1cm"/>
            <fo:table-column column-width="15.7cm"/>
            <fo:table-body >
              <fo:table-row >
              <fo:table-cell></fo:table-cell>
                  <fo:table-cell >
                        <fo:block space-after="10pt" ></fo:block>
                            <fo:table border="0.05mm solid" table-layout="fixed">
                            <fo:table-column column-width="0.9cm" />
                              <fo:table-column column-width="1.8cm" />
                              <fo:table-column column-width="6.3cm" />
                              <fo:table-column column-width="1.5cm" />
                              <fo:table-column column-width="2.6cm" />
                              <fo:table-column column-width="2.6cm" />
                              <fo:table-body >
                                <!--Contents here -->
                              </fo:table-body >
                            </fo:table >
                  </fo:table-cell >
              </fo:table-row >
            </fo:table-body >
        </fo:table>
        </xsl:template>
 
</xsl:stylesheet>

Reply via email to