Loading ...
Sorry, an error occurred while loading the content.
 

fo:external-graphics tag

Expand Messages
  • vijay_singh
    Hi I am using FOP as FO engine and I have a requirement where I don t know the size of the image. But if the image is with more than 500pt height I should
    Message 1 of 3 , Sep 12, 2005
      Hi

      I am using FOP as FO engine and I have a requirement where I don't know
      the size of the image. But if the image is with more than 500pt height
      I should shrink and it and scale the image accordingly, but if the
      image has height less than 500pt i shouldn't not strech the image
      height.

      Now I can shrink the image height to 500pt by height attribute of the
      fo:external-graphics tag and make the scale=uniform, but this strechs
      the smaller image.

      Anybody has any idea?

      Regards
      Vijay
    • W. Eliot Kimber
      ... With FO 1.0, the only thing you can do, short of a proprietary extension, is to determine the graphic s size at the time you generate the FO. This can be
      Message 2 of 3 , Sep 13, 2005
        --- In XSL-FO@yahoogroups.com, "vijay_singh" <vijay_singh@y...> wrote:
        > Hi
        > Now I can shrink the image height to 500pt by height attribute of the
        > fo:external-graphics tag and make the scale=uniform, but this strechs
        > the smaller image.

        With FO 1.0, the only thing you can do, short of a proprietary
        extension, is to determine the graphic's size at the time you generate
        the FO. This can be done fairly easily with Java through an XSLT
        extension function, using the Sun-provided JAI library:

        RenderedOp img = JAI.create("fileload", fileName);
        height = String.valueOf(img.getHeight());
        width = String.valueOf(img.getWidth());

        Given this info you should then be able to determine whether the
        graphic should be scaled down or left alone.

        In FO 1.1 the set of scaling options has been extended to provide for
        this case.

        Cheers,

        Eliot
      • vijay_singh
        ... the ... strechs ... generate ... for ... Thanks Eliot
        Message 3 of 3 , Sep 15, 2005
          --- In XSL-FO@yahoogroups.com, "W. Eliot Kimber" <ekimber@i...> wrote:
          > --- In XSL-FO@yahoogroups.com, "vijay_singh" <vijay_singh@y...>
          wrote:
          > > Hi
          > > Now I can shrink the image height to 500pt by height attribute of
          the
          > > fo:external-graphics tag and make the scale=uniform, but this
          strechs
          > > the smaller image.
          >
          > With FO 1.0, the only thing you can do, short of a proprietary
          > extension, is to determine the graphic's size at the time you
          generate
          > the FO. This can be done fairly easily with Java through an XSLT
          > extension function, using the Sun-provided JAI library:
          >
          > RenderedOp img = JAI.create("fileload", fileName);
          > height = String.valueOf(img.getHeight());
          > width = String.valueOf(img.getWidth());
          >
          > Given this info you should then be able to determine whether the
          > graphic should be scaled down or left alone.
          >
          > In FO 1.1 the set of scaling options has been extended to provide
          for
          > this case.
          >
          > Cheers,
          >
          > Eliot

          Thanks Eliot
        Your message has been successfully submitted and would be delivered to recipients shortly.