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

David Cramer david at thingbag.net
Fri Aug 6 18:18:46 PDT 2010


  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 at 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



***SPAM***

!DSPAM:28,4c5cb604409581007013477!


-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at 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



More information about the Xep-support mailing list