Java Mailing List Archive

http://www.java2.5341.com/

Home » fop-users.xmlgraphics »

"fo:external-graphic" inside a "fo:block" - Unexpected margins

Léa Massiot

2012-05-29

Replies: Find Java Web Hosting

Author LoginPost Reply

Hello and thank you for reading my post.

When I put a "fo:external-graphic" inside a "fo:block" (cf. the XSL-FO
stylesheet below and the resulting PDF document attached), I get:
- an extra (red) margin above the image,
- an extra (red) margin below the image (bigger than the previous),
- no extra left or right margins.

What are these margins?
Can they be removed?

Nota:
In the PDF file attached, the image is a GIF image.
The background of the "fo:external-graphic" element is green (rgb(0,255,0)).
The background of the "fo:block" element is red (rgb(255,0,0)).

Thank you and best regards.


XSF-FO stylesheet

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                   xmlns:fo="http://www.w3.org/1999/XSL/Format">
                   
<xsl:template match="quotation">
 
  <fo:root>
 
   <fo:layout-master-set>
    <fo:simple-page-master master-name = "A4-portrait"
                    page-height="{@(protected)}"
                    page-width="{@(protected)}"
                    margin="{@(protected)}"                          
                    >
                         
      <fo:region-body background-color="orange" />
     
    </fo:simple-page-master>
   </fo:layout-master-set>

   <fo:page-sequence master-reference="A4-portrait">
    <fo:flow flow-name="xsl-region-body">
      <xsl:apply-templates select="area" />
    </fo:flow>
   </fo:page-sequence>
  </fo:root>
   
</xsl:template>

<xsl:template match="area">

   <fo:block background-color="rgb(255, 0, 0)">
     <fo:external-graphic content-height="120%"
                   scaling="uniform"
                   background-color="rgb(0, 255, 0)"
                   src="url(images/try_36px_36px.gif)" />
   
    <fo:external-graphic content-height="120%"
                   scaling="uniform"
                   background-color="rgb(0, 255, 0)"
                   src="url(images/try_36px_36px.gif)" />
   </fo:block>
 
</xsl:template>
</xsl:stylesheet>
http://old.nabble.com/file/p33924810/test_fo_external_graphic.pdf
test_fo_external_graphic.pdf

--
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
For additional commands, e-mail: fop-users-help@(protected)

©2008 java2.5341.com - Jax Systems, LLC, U.S.A.