Hi Antii,

If you have a look at the stylesheets, where the images are scaled,
you will see that only width is considered. As far as I know there is
no solution out of the box. You can try to extend your stylesheet with
logic to calculate the resize precentage of both scaling possibilities
(in height and width) and finally base the decision on the result.

The problem is that you have to know the exact available height and
width of the body. I tried this solution long time ago and it worked
really good as long as the image wasn't embedded in some other
elements, because the available width and height will change. If your
images occure always in full body page width and height it should be
straight forward.

Cheers, Tobias



On Mon, Feb 16, 2009 at 5:02 PM, Antti Karanta <[email protected]> wrote:
>
>
>                          Hi!
>
>  I'm trying to find ways to scale images in pdf output but I can't seem to
> find the right way.
>
>  I have these cases which I need to support:
>
> scale image to fill the width of the page, scaling depth accordingly
>        => this one can be done by setting imagedata attributes scalefit="1"
> width="100%"
> scale image to fill the depth of the page, scaling width accordingly
> scale image to fill the width and depth of the page (i.e. fill the whole
> page up to margins)
> scale image to fill the available depth on the current page
>        * width is scaled accordingly, unless set to 100% of page width
>        * by available depth I mean that if the usable page height is H and
> there is e.g. text on the page that takes height TH, the size of the image
> is H - TH. Margins are respected, i.e. total page height = H + top margin +
> bottom margin.
>        * picture may have minimum depth beyond which it should not be shrunk
>
>  Are these doable?
>
>
>  I read through
>
> http://www.sagehill.net/docbookxsl/ImageSizing.html
>
> and
>
> http://www.docbook.org/tdg/en/html/imagedata.html
>
>  but could not figure out answers to these except the first one.
>
>
>  Here's a sample of what I'm doing:
>
>        <informalfigure>
>                <mediaobject>
>                        <imageobject role="fo">
>                                <imagedata align="left" scalefit="1"
> width="100%" fileref="svg-test1.svg" format="SVG"/>
>                        </imageobject>
>                </mediaobject>
>        </informalfigure>
>
>
>
>  Environment:
>    docbook-xsl 1.74.0
>    fop 0.95
>    java 1.6.0_11
>    saxon 9.1.0.5
>    win xp sp 2
>
>
>
>       ::Antti::
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

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

Reply via email to