RE: [xep-support] [SPAM] Image scaling to fit available height

From: Jan Tošovský <j.tosovsky@gmc.net>
Date: Thu Aug 19 2010 - 06:26:18 PDT

Hi David,

thanks for this hint. I've tested Kevin's solution, but it works only partly. My slide contains two paragraphs, each with four lines. It occupies approx the half of available area. The second half is available for my image. What I can achieve is placement the image on the additional slide. It is really downsized, so it fits available area, but the available area of empty slide, not available area of the first slide :-(

I've tried to set keep-with-previous attribute to 'always', but it creates 3 slides - the first with the first paragraph and two first lines of the second one, the second slide contains remaining two lines of the second paragraph and finally, the image is placed on the third slide.

What helps is setting the 'fit-height' parameter of 'scale-image-to-fit' template to lower value that is less than available height. But such a manual setting is useless for intended automated processing (every slide has a different space).

This solution is sufficient for documents where overflowing to another page is not so crucial, but in case of slides it is unacceptable.

Is there another solution for my problem?

Best regards,

Jan

________________________________________
From: David Cramer [david@thingbag.net]
Sent: Saturday, August 07, 2010 3:18 AM
To: xep-support@renderx.com
Cc: Jan Tošovský
Subject: Re: [xep-support] [SPAM] Image scaling to fit available height

  Hi Jan,
In fact, the xsl-fo 1.1 spec provides a mechanism to handle just your
situation. You can set content-width="scale-down-to-fit" and the fo
renderer will know to scale your image down proportionally only if
there's not enough room for it. Sadly, however, xep does not yet support
scale-down-to-fit, though I believe Antenna House and FOP do.

There's a thread discussing the issue that starts here:
http://services.renderx.com/lists/xep-support/6210.html

And concludes here, with Kevin providing a hack to workaround this
limitation in xep:
http://services.renderx.com/lists/xep-support/6225.html

I'm glad to see you bringing up the situation. I had some trouble
convincing Kevin that it is a legitimate use case. I would still very
much prefer for xep to support scale-down-to-fit than to resort to the
post-processing they suggest.

Good luck,
David

On 8/6/2010 9:03 AM, Jan Tošovský wrote:
> Hello Everyone,
>
> in my 'portrait' documents I use quite reliable method of scaling images to fit the available width:
>
> <fo:block>
> <fo:external-graphic
> src="url(Images/test.png)"
> width="100%"
> height="auto"
> content-width="scale-to-fit"
> content-height="100%"/>
> </fo:block>
>
> Now I prepare slides-looking output (landscape) with some text followed by an image. In this scenario it would be helpful to use the similar method as above, but to fill the available height. I've tried to switch corresponding attribute values, but if the image is taller, I am getting [error] no space for an element, trying to recover - and this image is missing in the output.
>
> Here is my current code:
>
> <fo:block>
> <fo:external-graphic
> src="url(Images/test.png)"
> width="auto"
> height="100%"
> content-width="100%"
> content-height="scale-to-fit" />
> </fo:block>
>
> Is there any method how to achieve this? I don't want to specify available height explicitly for every image as my template is intended for automated processing...
>
> Regards,
>
> Jan
>
>
> ***SPAM***
>
>
>
>
> -------------------
> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
> in the body of the message to majordomo@renderx.com from the address
> you are subscribed from.
> (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
!DSPAM:28,4c6d30e8409581682370033!

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Thu Aug 19 06:55:51 2010

This archive was generated by hypermail 2.1.8 : Thu Aug 19 2010 - 06:56:00 PDT