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 joe armstrong <jo...@gmail.com> on 2010/12/06 22:13:13 UTC

exact dimensions in apache fop

Hello,

I'm trying to understand page layouts in apache fop. I have set a page width
of 21 cm and margin-left + margin-right to 5 cm, so I should get 16 cm of
content. When I process and print on my laser printer and *measure* I get
only 15 cm for the content.

I set the extent of region-start to 3.0cm but when I measure I get 2.8cm

I have printed this on a macbook, using the print menu in the
preview program I have set scale to 100% and disable "scale to fit"

Is this a common problem? Can I expect precise dimensions in the
printed output?

I'm using apache fop version 1.0

My test program is appended.

If you process and print this on your local printer and them take a ruler
and measure do you get a region-start of exactly 3.0cm?

Or is my program wrong?

Cheers

/Joe Armstrong

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
         master-name="odd"
         page-height="29.7cm"
         page-width="21cm"
         margin-top="2.5cm"
         margin-bottom="2.5cm"
         margin-left="3.0cm"
         margin-right="2.0cm">

     <fo:region-body
         background-color="#eeeeee"	
         region-name="xsl-region-body"
         margin-top="0.6in"
         margin-bottom="5.0cm"
         margin-left="3.5cm"
         margin-right="2.5cm"/>

     <fo:region-before
	 background-color="yellow"		
	 precedence="true"
	 region-name="xsl-region-before"
	 extent="1.0cm"/>

     <fo:region-after
	 background-color="orange"
	 region-name="xsl-region-after"
	 extent="1.5cm"
	 precedence="true"/>

     <fo:region-start
	 background-color="pink"
	 region-name="xsl-region-start"
	 extent="3.0cm"/>

     <fo:region-end
	 background-color="#efefef"
	 region-name="xsl-region-end"
	 extent="2.0cm"/>

</fo:simple-page-master>

</fo:layout-master-set>

  <fo:page-sequence master-reference="odd" format="A">
     
    <fo:static-content
       flow-name="xsl-region-start">
       <fo:block> 
	 Page: <fo:page-number/>
	 <fo:block>This is region Start, extent=3.0cm</fo:block>
       </fo:block>
     </fo:static-content>
     
     <fo:static-content
       flow-name="xsl-region-end">
       <fo:block>region end. extent = "2.0cm"<fo:page-number/>

       </fo:block>
     </fo:static-content>

     <fo:static-content flow-name="xsl-region-before" >
       <fo:block display-align="before">Region before extent=1.0cm

       </fo:block>
     </fo:static-content>

     <fo:static-content
       flow-name="xsl-region-after"
       display-align="after">

       <fo:block
        text-align="center">Page <fo:page-number/>
       region-after extent=1.5cm
       </fo:block>
	     
     </fo:static-content>

     <fo:flow flow-name="xsl-region-body">
       <fo:block   linefeed-treatment="preserve"
		   white-space-collapse="false" 
		   white-space-treatment="preserve" 
		   >
	 These are the simple-page-master values
         master-name="odd"
         page-height="29.7cm"
         page-width="21cm"
         margin-top="2.5cm"
         margin-bottom="2.5cm"
         margin-left="3.0cm"
         margin-right="2.0cm">
       </fo:block>
       <fo:block>
	 This is xsl-region-body. margin-left="3.5cm" this is 0.5 cm larger than
	 the extent of region-start.
	 margin-right= 2.5 cm, ie 0.5 cm larger than the extent of the 
	 thing to the right. Margin-bottom is 5.0cm
      </fo:block>

      <fo:list-block provisional-distance-between-starts="0.5in"
		     provisional-label-separation="0.1in" 
		     space-before.optimum="6pt"
		     start-indent="0.5in">
	<fo:list-item relative-align="baseline">
	  <fo:list-item-label text-align="end" 
			      start-indent="1.0cm"
			      end-indent="6.0cm">
	    <fo:block text-align="justify">
	      The Extensible Markup Language (XML) is a subset of SGML.
	      start-indent = 1.0 cm end - indent = 6.0 cm
	    </fo:block>
	  </fo:list-item-label>
	  <fo:list-item-body start-indent="5.0cm" end-indent="1.0cm">
	    <fo:block text-align="justify">
	      start-indent = 5 cm end-ident=1.0 cm
	      The Extensible Markup Language (XML) is a subset of SGML that
	      is completely described in this document. Its goal is to enable
	      generic SGML to be served, received, and processed on the Web
	      in the way that is now possible with HTML.
	      The Extensible Markup Language (XML) is a subset of SGML that
	      is completely described in this document.
	    </fo:block>
	  </fo:list-item-body>
	</fo:list-item>
      </fo:list-block>
         


     </fo:flow>
</fo:page-sequence>

</fo:root>





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


Re: exact dimensions in apache fop

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Are you printing PDF from Acrobat Reader? If yes, please see:
http://xmlgraphics.apache.org/fop/faq.html#pdf-print-contortion

On 06.12.2010 22:13:13 joe armstrong wrote:
> Hello,
> 
> I'm trying to understand page layouts in apache fop. I have set a page width
> of 21 cm and margin-left + margin-right to 5 cm, so I should get 16 cm of
> content. When I process and print on my laser printer and *measure* I get
> only 15 cm for the content.
> 
> I set the extent of region-start to 3.0cm but when I measure I get 2.8cm
> 
> I have printed this on a macbook, using the print menu in the
> preview program I have set scale to 100% and disable "scale to fit"
> 
> Is this a common problem? Can I expect precise dimensions in the
> printed output?
> 
> I'm using apache fop version 1.0
> 
> My test program is appended.
> 
> If you process and print this on your local printer and them take a ruler
> and measure do you get a region-start of exactly 3.0cm?
> 
> Or is my program wrong?
> 
> Cheers
> 
> /Joe Armstrong
> 
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master
>          master-name="odd"
>          page-height="29.7cm"
>          page-width="21cm"
>          margin-top="2.5cm"
>          margin-bottom="2.5cm"
>          margin-left="3.0cm"
>          margin-right="2.0cm">
> 
>      <fo:region-body
>          background-color="#eeeeee"	
>          region-name="xsl-region-body"
>          margin-top="0.6in"
>          margin-bottom="5.0cm"
>          margin-left="3.5cm"
>          margin-right="2.5cm"/>
> 
>      <fo:region-before
> 	 background-color="yellow"		
> 	 precedence="true"
> 	 region-name="xsl-region-before"
> 	 extent="1.0cm"/>
> 
>      <fo:region-after
> 	 background-color="orange"
> 	 region-name="xsl-region-after"
> 	 extent="1.5cm"
> 	 precedence="true"/>
> 
>      <fo:region-start
> 	 background-color="pink"
> 	 region-name="xsl-region-start"
> 	 extent="3.0cm"/>
> 
>      <fo:region-end
> 	 background-color="#efefef"
> 	 region-name="xsl-region-end"
> 	 extent="2.0cm"/>
> 
> </fo:simple-page-master>
> 
> </fo:layout-master-set>
> 
>   <fo:page-sequence master-reference="odd" format="A">
>      
>     <fo:static-content
>        flow-name="xsl-region-start">
>        <fo:block> 
> 	 Page: <fo:page-number/>
> 	 <fo:block>This is region Start, extent=3.0cm</fo:block>
>        </fo:block>
>      </fo:static-content>
>      
>      <fo:static-content
>        flow-name="xsl-region-end">
>        <fo:block>region end. extent = "2.0cm"<fo:page-number/>
> 
>        </fo:block>
>      </fo:static-content>
> 
>      <fo:static-content flow-name="xsl-region-before" >
>        <fo:block display-align="before">Region before extent=1.0cm
> 
>        </fo:block>
>      </fo:static-content>
> 
>      <fo:static-content
>        flow-name="xsl-region-after"
>        display-align="after">
> 
>        <fo:block
>         text-align="center">Page <fo:page-number/>
>        region-after extent=1.5cm
>        </fo:block>
> 	     
>      </fo:static-content>
> 
>      <fo:flow flow-name="xsl-region-body">
>        <fo:block   linefeed-treatment="preserve"
> 		   white-space-collapse="false" 
> 		   white-space-treatment="preserve" 
> 		   >
> 	 These are the simple-page-master values
>          master-name="odd"
>          page-height="29.7cm"
>          page-width="21cm"
>          margin-top="2.5cm"
>          margin-bottom="2.5cm"
>          margin-left="3.0cm"
>          margin-right="2.0cm">
>        </fo:block>
>        <fo:block>
> 	 This is xsl-region-body. margin-left="3.5cm" this is 0.5 cm larger than
> 	 the extent of region-start.
> 	 margin-right= 2.5 cm, ie 0.5 cm larger than the extent of the 
> 	 thing to the right. Margin-bottom is 5.0cm
>       </fo:block>
> 
>       <fo:list-block provisional-distance-between-starts="0.5in"
> 		     provisional-label-separation="0.1in" 
> 		     space-before.optimum="6pt"
> 		     start-indent="0.5in">
> 	<fo:list-item relative-align="baseline">
> 	  <fo:list-item-label text-align="end" 
> 			      start-indent="1.0cm"
> 			      end-indent="6.0cm">
> 	    <fo:block text-align="justify">
> 	      The Extensible Markup Language (XML) is a subset of SGML.
> 	      start-indent = 1.0 cm end - indent = 6.0 cm
> 	    </fo:block>
> 	  </fo:list-item-label>
> 	  <fo:list-item-body start-indent="5.0cm" end-indent="1.0cm">
> 	    <fo:block text-align="justify">
> 	      start-indent = 5 cm end-ident=1.0 cm
> 	      The Extensible Markup Language (XML) is a subset of SGML that
> 	      is completely described in this document. Its goal is to enable
> 	      generic SGML to be served, received, and processed on the Web
> 	      in the way that is now possible with HTML.
> 	      The Extensible Markup Language (XML) is a subset of SGML that
> 	      is completely described in this document.
> 	    </fo:block>
> 	  </fo:list-item-body>
> 	</fo:list-item>
>       </fo:list-block>
>          
> 
> 
>      </fo:flow>
> </fo:page-sequence>
> 
> </fo:root>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




Jeremias Maerki


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


Re: exact dimensions in apache fop

Posted by joe armstrong <jo...@gmail.com>.
Pascal Sancho <pascal.sancho <at> takoma.fr> writes:

> 
> Hi,
> 
> You should check your printer settings:
> did you uncheck the [scale to print] option?

Not exactly - I used the "Preview" program in mac OS-X on a macbook
the print menu only has a scale option which I selected and then set the
scale factor to 100%.

I tried using the print menu in adobe reader 9 and printed with page scaling=none
this was much better.

What I calculated should give a 16 cm region I measured to be 15.9cm
(the same result on using "Preview" was 15cm) so I guess I should go
with the adobe printer. I'm still not happy about the 0.1 cm error -
but I guess it would be difficult to pin this down - my main worry was that
my code was incorrect and I has some padding (or something) that I'd forgotten
about - when I got 15 cm instead of 16 I worried that something was seriously
wrong.

Thanks for your help

/Joe


> 
> Le 06/12/2010 22:13, joe armstrong a écrit :
> > I'm trying to understand page layouts in apache fop. I have set a page width
> > of 21 cm and margin-left + margin-right to 5 cm, so I should get 16 cm of
> > content. When I process and print on my laser printer and *measure* I get
> > only 15 cm for the content.
> 
> --
> Pascal
> 





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


Re: exact dimensions in apache fop

Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,

You should check your printer settings:
did you uncheck the [scale to print] option?

Le 06/12/2010 22:13, joe armstrong a écrit :
> I'm trying to understand page layouts in apache fop. I have set a page width
> of 21 cm and margin-left + margin-right to 5 cm, so I should get 16 cm of
> content. When I process and print on my laser printer and *measure* I get
> only 15 cm for the content.

--
Pascal


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