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 Tim Gates <tg...@iress.com.au> on 2008/01/03 02:07:40 UTC
Filling a table cell entirely with an external graphic
Hi,
I have a series of problems which can be broken down into one problem in that I don't understand how to eliminate the implicit padding associated with an external graphic inside a table. If I try and create 4 images side by side then there is a gap between the top two images and the bottom two images using a variation of the basic FO below...
<fo:table table-layout="fixed" >
<fo:table-column column-width="50mm" />
<fo:table-column column-width="50mm" />
<fo:table-body >
<fo:table-row>
<fo:table-cell><fo:block><fo:external-graphic content-width="50mm" content-height="50mm" src="test.png"/></fo:block></fo:table-cell>
<fo:table-cell><fo:block><fo:external-graphic content-width="50mm" content-height="50mm" src="test.png"/></fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell><fo:block><fo:external-graphic content-width="50mm" content-height="50mm" src="test.png"/></fo:block></fo:table-cell>
<fo:table-cell><fo:block><fo:external-graphic content-width="50mm" content-height="50mm" src="test.png"/></fo:block></fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
I've tried adjusting margins, space and padding and setting them to zero on pretty much every XML element (which I've removed from the above for clarity). Does anyone know how to eliminate the padding to produce the 4 images side by side without resorting to setting the images as background images?
Thanks,
Tim.
**********************************************************************************************
Important Note
This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the
sender immediately and delete this email. Any views expressed in this email are not necessarily the views of IRESS Market Technology Limited.
It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system.
IRESS Market Technology Limited does not warrant that the information is free of a virus or any other defect or error.
**********************************************************************************************
Re: Filling a table cell entirely with an external graphic
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jan 3, 2008, at 02:07, Tim Gates wrote:
Hi,
> I have a series of problems which can be broken down into one
> problem in that I don't understand how to eliminate the implicit
> padding associated with an external graphic inside a table. If I
> try and create 4 images side by side then there is a gap between
> the top two images and the bottom two images using a variation of
> the basic FO below...
>
> <fo:table table-layout="fixed" >
> <fo:table-column column-width="50mm" />
> <fo:table-column column-width="50mm" />
> <fo:table-body >
> <fo:table-row>
> <fo:table-cell><fo:block><fo:external-graphic content-
> width="50mm" content-height="50mm" src="test.png"/></fo:block></
> fo:table-cell>
> <fo:table-cell><fo:block><fo:external-graphic content-
> width="50mm" content-height="50mm" src="test.png"/></fo:block></
> fo:table-cell>
> </fo:table-row>
> <fo:table-row>
> <fo:table-cell><fo:block><fo:external-graphic content-
> width="50mm" content-height="50mm" src="test.png"/></fo:block></
> fo:table-cell>
> <fo:table-cell><fo:block><fo:external-graphic content-
> width="50mm" content-height="50mm" src="test.png"/></fo:block></
> fo:table-cell>
> </fo:table-row>
> </fo:table-body>
> </fo:table>
> I've tried adjusting margins, space and padding and setting them to
> zero on pretty much every XML element (which I've removed from the
> above for clarity). Does anyone know how to eliminate the padding
> to produce the 4 images side by side without resorting to setting
> the images as background images?
If I remember correctly, this is a result of what is called 'half-
leading', i.e. each line in a block has a leading and trailing
whitespace (before and after) with an extent equal to a percentage of
the line-height for the block in question.
Something like the following should work:
<fo:table line-height="0pt" ...>
etc.
Since line-height is inherited by all the table descendants, half-
leading will be equal to zero for the lines generated by the cells/
blocks, and the spurious whitespace between the graphics should
disappear.
HTH!
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org