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

How to align text and image in same line?

Expand Messages
  • fanyinfo
    Hi all, In , I m trying to align the text and image in the same line, but couldn t get it right. The PDF output I want is like following: Text before
    Message 1 of 4 , Nov 9, 2004
    • 0 Attachment
      Hi all,

      In <fo:block>, I'm trying to align the text and image in the same
      line, but couldn't get it right. The PDF output I want is like
      following:

      Text before image [IMAGE HERE] Text after image.

      xxxxxxx
      xxxxxxxxxxxxxxxxxxxx x IMG x xxxxxxxxxxxxxxxxxxxxx
      xxxxxxx

      Image is larger than the text line--text is aligned in the middle
      but not across the image.

      Currently, it display as
      xxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxx
      x IMG x
      xxxxxxx

      I have tried to put image into <fo:inline>, or <fo:table>, but it
      didn't work. and My FOP do not support <fo:inline-container>.


      Thank you in advance!
      Fanyin
    • fanyinfo
      Hi all, Sorry to repost it. The image was not align together in previous post. so I add -- as space to align the image. In , I m trying to align
      Message 2 of 4 , Nov 9, 2004
      • 0 Attachment
        Hi all,

        Sorry to repost it. The image was not align together in previous
        post. so I add "--" as space to align the image.

        In <fo:block>, I'm trying to align the text and image in the same
        line, but couldn't get it right. The PDF output I want is like
        following:

        Text before image [IMAGE HERE] Text after image.

        -------------------- xxxxxxx
        xxxxxxxxxxxxxxxxxxxx x IMG x xxxxxxxxxxxxxxxxxxxxx
        -------------------- xxxxxxx

        Image is larger than the text line--text is aligned in the middle
        but not across the image.

        Currently, it display as
        xxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxx
        ------------------- x IMG x
        ------------------- xxxxxxx

        I have tried to put image into <fo:inline>, or <fo:table>, but it
        didn't work. and My FOP do not support <fo:inline-container>.


        Thank you in advance!
        Fanyin
      • J.Pietschmann
        ... The spec provides a variety of vertical alignment, baseline and baseline shift properties fro this purpose. ... Unfortunately, FOP 0.20.5 doesn t implement
        Message 3 of 4 , Nov 9, 2004
        • 0 Attachment
          fanyinfo wrote:
          > In <fo:block>, I'm trying to align the text and image in the same
          > line, but couldn't get it right

          The spec provides a variety of vertical alignment, baseline
          and baseline shift properties fro this purpose.

          > My FOP do not support <fo:inline-container>.

          Unfortunately, FOP 0.20.5 doesn't implement any of the properties
          necessary for general vertical center alignment (FOP 1.0dev does).
          There may still be special cases where the effect may be achieved
          with a table (try display-align="center" on the cells) or by other
          means.

          J.Pietschmann
        • fanyinfo
          I have tried those properties but it still not work correctly. Following is a code snapshot, the border and color only for visual purpose. To see if you can
          Message 4 of 4 , Nov 9, 2004
          • 0 Attachment
            I have tried those properties but it still not work correctly.
            Following is a code snapshot, the border and color only for visual
            purpose. To see if you can make it works. Again the output will look
            like
            -------------------- xxxxxxx
            xxxxxxxxxxxxxxxxxxxx x IMG x xxxxxxxxxxxxxxxxxxxxx
            -------------------- xxxxxxx



            <fo:table table-layout="fixed" width="100%">
            <fo:table-column/>
            <fo:table-body>
            <fo:table-row>
            <fo:table-cell display-align="before">
            <fo:block space-before="30pt" font-weight="normal" font-size="11pt"
            line-height="10pt" font-family="Verdana" border-before-style="solid"
            border-after-style="solid" border-start-style="solid" border-end-
            style="solid" border-top-color="red" border-bottom-color="red">
            • Each page is <fo:inline display-align="center" height="30pt"
            width="20pt" border-before-style="solid" border-after-style="solid"
            border-start-style="solid" border-end-style="solid" border-top-
            color="yellow" border-bottom-color="yellow" color="red" text-
            align="center">IMG START HERE
            <fo:external-graphic baseline-shift="super"
            src="img1.jpg" width="19.92pt" height="29.04pt" border="0"/>
            End HERE
            </fo:inline> inches wide.

            <fo:block font-size=".5pt" space-after="1.25pt"
            space-before="1.25pt"></fo:block>
            • Each picture is <fo:inline display-align="center"
            height="30pt" width="20pt" border-before-style="solid" border-after-
            style="solid" border-start-style="solid" border-end-style="solid"
            border-top-color="yellow" border-bottom-color="yellow" color="red"
            text-align="center"> IMG START HERE
            <fo:external-graphic baseline-shift="super"
            src="img2.jpg" width="18.96pt" height="29.04pt" border="0"/>
            End HERE
            </fo:inline> inches wide.
            </fo:block>
            </fo:table-cell>
            </fo:table-row>
            </fo:table-body>
            </fo:table>

            Thanks,
            Fanyin




            --- In XSL-FO@yahoogroups.com, "J.Pietschmann" <j3322ptm@y...> wrote:
            > fanyinfo wrote:
            > > In <fo:block>, I'm trying to align the text and image in the same
            > > line, but couldn't get it right
            >
            > The spec provides a variety of vertical alignment, baseline
            > and baseline shift properties fro this purpose.
            >
            > > My FOP do not support <fo:inline-container>.
            >
            > Unfortunately, FOP 0.20.5 doesn't implement any of the properties
            > necessary for general vertical center alignment (FOP 1.0dev does).
            > There may still be special cases where the effect may be achieved
            > with a table (try display-align="center" on the cells) or by other
            > means.
            >
            > J.Pietschmann
          Your message has been successfully submitted and would be delivered to recipients shortly.