You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Mohamed Abdel Hamid <mo...@imkenberg.net> on 2003/02/04 13:41:35 UTC

How to adjust page layout

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>

Re: How to adjust page layout

Posted by Mohamed Abdel Hamid <mo...@imkenberg.net>.
thanx for your answer
about printer setting which i adjust is only paper size ( i choose A4)
becuase i adjust page on this size.
there is another option called Scale to fit in the printer setting but i
didn't try it yet .


----- Original Message -----
From: "Oleg Tkachenko" <ol...@multiconn.com>
To: <fo...@xml.apache.org>
Sent: Tuesday, February 04, 2003 3:58 PM
Subject: Re: How to adjust page layout


> Mohamed Abdel Hamid wrote:
>
> > 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 :
>
> Correct me if I'm wrong, but I believe printers have unprintable areas on
a
> parer, have you tried to customize printing settings?
>
> --
> Oleg Tkachenko
> Multiconn Technologies, Israel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: How to adjust page layout

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Mohamed Abdel Hamid wrote:

> 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 :

Correct me if I'm wrong, but I believe printers have unprintable areas on a 
parer, have you tried to customize printing settings?

-- 
Oleg Tkachenko
Multiconn Technologies, Israel


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org