Eliminating block's padding around an external-graphic

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Eliminating block's padding around an external-graphic

cwulf
Hi,

I'm placing images with different heights into table rows. The highest image within a row should define the height of the row. All other images are centered vertically. The table-cells get a background-color, so when an image's height is less than the height of the highest image of its row, one should see the background-color above and below that image.

But I've noticed the background-color above and below the highest image, too. Especially in rows with just images of definitely same size (where the background-color never should appear) I can see a padding to the top and a larger padding to the bottom.

So I made a simple test without a table:

<fo:block text-align="center" background-color="cyan"
	padding="0" margin="0" start-indent="0" end-indent="0" space-before="0" space-after="0">
	<fo:external-graphic
		border="1px solid magenta"
	 	padding="0" margin="0" space-start="0" space-end="0" pause-before="0" pause-after="0"
	 	src="@Resources.projectResource(getClass, "public/images/calendar.png").get"/>
</fo:block>

The result is:



Altough padding, margin (and some other properties I tried to fix this) are set to 0 for the block and the external-graphic there is still some space above and below the image.

The result I expected would be something like this:



What properties can I add to eliminate that (cyan) space above and below the image?

Thx a lot in advance,
Christoph

P.S.: I am using FOP 1.0
Reply | Threaded
Open this post in threaded view
|

RE: Eliminating block's padding around an external-graphic

Robert Meyer-5
Hi Christoph,

If I'm understanding correctly, this issue is caused by FOP taking into consideration line spacing even when there's no text. Try setting the parent block to have font-size="0" and that should resolve the problem.

If that doesn't resolve it or do what you want it to, it might be best to post a sample FO file to show the problem and I'll take another look.

Regards,

Robert Meyer

From: [hidden email]
Sent: ‎10/‎08/‎2013 12:49
To: [hidden email]
Subject: Eliminating block's padding around an external-graphic

Hi,

I'm placing images with different heights into table rows. The highest image
within a row should define the height of the row. All other images are
centered vertically. The table-cells get a background-color, so when an
image's height is less than the height of the highest image of its row, one
should see the background-color above and below that image.

But I've noticed the background-color above and below the highest image,
too. Especially in rows with just images of definitely same size (where the
background-color never should appear) I can see a padding to the top and a
larger padding to the bottom.

So I made a simple test without a table:



The result is:

<http://apache-fop.1065347.n5.nabble.com/file/n39020/screen.png>

Altough *padding*, *margin* (and some other properties I tried to fix this)
are set to *0* for the *block* and the *external-graphic* there is still
some space above and below the image.

The result I expected would be something like this:

<http://apache-fop.1065347.n5.nabble.com/file/n39020/nominal.png>

What properties can I add to eliminate that (cyan) space above and below the
image?

Thx a lot in advance,
Christoph

P.S.: I am using FOP 1.0



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Eliminating-block-s-padding-around-an-external-graphic-tp39020.html
Sent from the FOP - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Eliminating block's padding around an external-graphic

cwulf
Hello Robert,

that has been it. Thanks a lot!

Regards,
Christoph

Robert Meyer-5 wrote
If I'm understanding correctly, this issue is caused by FOP taking into consideration line spacing even when there's no text. Try setting the parent block to have font-size="0" and that should resolve the problem.