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

Graphic measurments on XSL:FO using renderx XEP

Expand Messages
  • mina_hurray
    Hi all: I am not sure how to word my question. Basically, I have a graphic having width and height in Inches. As in 7.5Inches and 7.84Inches . Now, on the
    Message 1 of 5 , Jan 30, 2007
    • 0 Attachment
      Hi all:

      I am not sure how to word my question. Basically, I have a graphic
      having width and height in Inches. As in '7.5Inches' and '7.84Inches'.
      Now, on the FO styles sheet, I use renderx xep as the processor, when
      I am displaying the graphic height and width using
      <fo:external-graphic content-width="" content-height=""/>

      If my input xml graphic has:

      <graphic src="" width="7.5Inches" height="7.84Inches"/>

      On the fo style sheet,

      Can I just say:

      <fo:external-graphic>
      <xsl:attribute name="content-width">
      <xsl:choose>

      <xsl:when test="@width">
      <xsl:value-of select="@width"/>
      </xsl:when>
      <xsl:otherwise>90%</xsl:otherwise>
      </xsl:choose>
      </xsl:attribute>
      <xsl:attribute name="content-height">
      <xsl:choose>

      <xsl:when test="@height">
      <xsl:value-of select="@height"/>
      </xsl:when>
      <xsl:otherwise>90%</xsl:otherwise>
      </xsl:choose>
      </xsl:attribute>
      </fo:external-graphic>

      Will this just display the graphics with the right width and height or
      should the width and height be converted to pixels?

      Thanks in advance for all your help.
    • J.Pietschmann
      ... Probably not, because XSLFO uses in as representation for the unit inch , as in content-height= 7.5in You can try to strip the Inches suffix, if it
      Message 2 of 5 , Jan 30, 2007
      • 0 Attachment
        mina_hurray wrote:
        > I am not sure how to word my question. Basically, I have a graphic
        > having width and height in Inches. As in '7.5Inches' and '7.84Inches'.
        ...
        > If my input xml graphic has:
        >
        > <graphic src="" width="7.5Inches" height="7.84Inches"/>
        ...
        > <xsl:when test="@height">
        > <xsl:value-of select="@height"/>
        ...
        > Will this just display the graphics with the right width and height or
        > should the width and height be converted to pixels?

        Probably not, because XSLFO uses "in" as representation for
        the unit "inch", as in
        content-height="7.5in"


        You can try to strip the "Inches" suffix, if it is fixed, and
        add the "in" in the XSLT. If the XML authors also use "1Inch"
        and/or "7.84inches" or something, you probably are in trouble.

        J.Pietschmann
      • mina_hurray
        Thank you for your response. Is it better then to convert the measuments from inches to Pixels using dpi of 75? How do I set the dpi? ... and 7.84Inches . ...
        Message 3 of 5 , Jan 31, 2007
        • 0 Attachment
          Thank you for your response. Is it better then to convert the
          measuments from inches to Pixels using dpi of 75? How do I set the
          dpi?


          --- In XSL-FO@yahoogroups.com, "J.Pietschmann" <j3322ptm@...> wrote:
          >
          > mina_hurray wrote:
          > > I am not sure how to word my question. Basically, I have a graphic
          > > having width and height in Inches. As in '7.5Inches'
          and '7.84Inches'.
          > ...
          > > If my input xml graphic has:
          > >
          > > <graphic src="" width="7.5Inches" height="7.84Inches"/>
          > ...
          > > <xsl:when test="@height">
          > > <xsl:value-of select="@height"/>
          > ...
          > > Will this just display the graphics with the right width and
          height or
          > > should the width and height be converted to pixels?
          >
          > Probably not, because XSLFO uses "in" as representation for
          > the unit "inch", as in
          > content-height="7.5in"
          >
          >
          > You can try to strip the "Inches" suffix, if it is fixed, and
          > add the "in" in the XSLT. If the XML authors also use "1Inch"
          > and/or "7.84inches" or something, you probably are in trouble.
          >
          > J.Pietschmann
          >
        • J.Pietschmann
          ... I don t understand the purpose of this approach. In most cases, image dimensions shouldn t be measured in pixels. Inches are fine. J.Pietschmann
          Message 4 of 5 , Jan 31, 2007
          • 0 Attachment
            mina_hurray wrote:
            > Thank you for your response. Is it better then to convert the
            > measuments from inches to Pixels using dpi of 75? How do I set the
            > dpi?

            I don't understand the purpose of this approach.
            In most cases, image dimensions shouldn't be measured in pixels.
            Inches are fine.

            J.Pietschmann
          • mina_hurray
            Thank you for your input. I shall retain the measurment in Inches.
            Message 5 of 5 , Feb 1, 2007
            • 0 Attachment
              Thank you for your input. I shall retain the measurment in Inches.


              --- In XSL-FO@yahoogroups.com, "J.Pietschmann" <j3322ptm@...> wrote:
              >
              > mina_hurray wrote:
              > > Thank you for your response. Is it better then to convert the
              > > measuments from inches to Pixels using dpi of 75? How do I set the
              > > dpi?
              >
              > I don't understand the purpose of this approach.
              > In most cases, image dimensions shouldn't be measured in pixels.
              > Inches are fine.
              >
              > J.Pietschmann
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.