Java Mailing List Archive

Home » fop-users.xmlgraphics »

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

Léa Massiot


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?

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"
<xsl:template match="quotation">
    <fo:simple-page-master master-name = "A4-portrait"
      <fo:region-body background-color="orange" />

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

<xsl:template match="area">

   <fo:block background-color="rgb(255, 0, 0)">
     <fo:external-graphic content-height="120%"
                   background-color="rgb(0, 255, 0)"
                   src="url(images/try_36px_36px.gif)" />
    <fo:external-graphic content-height="120%"
                   background-color="rgb(0, 255, 0)"
                   src="url(images/try_36px_36px.gif)" />

Sent from the FOP - Users mailing list archive at

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

©2008 - Jax Systems, LLC, U.S.A.