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

image map in xsl-fo

Expand Messages
  • bryan
    I was just wondering about this, consider it a light-weight thinking about the matter rather than a pressing need, but could one implement an image map in
    Message 1 of 9 , Oct 23, 2002
    • 0 Attachment
      I was just wondering about this, consider it a light-weight thinking
      about the matter rather than a pressing need, but could one implement an
      image map in xsl-fo i.e translate an well-formed html image map to a
      structure that would function in the same way in xsl-fo? It seems to me
      that using RenderX it might be possible considering the way linking is
      handled, although otherwise I can't see a way.

      I also thought it might be doable using svg in FOP to do it. Couldn't
      link directly to another part of your generated pdf but perhaps what one
      could do is have a link in the svg that went to mypdf.pdf#section7 for
      example.
    • W. Eliot Kimber
      ... Forgot to use url() function for src= value. Thanks to XEP s validator for catching that form me. Cheers, E. -- W. Eliot Kimber, eliot@isogen.com
      Message 2 of 9 , Oct 23, 2002
      • 0 Attachment
        W. Eliot Kimber wrote:
        > <fo:external-graphic content-width="scale-to-fit"
        > src="graphics/graphic-test-01.eps"/>

        Forgot to use "url()" function for src= value. Thanks to XEP's validator
        for catching that form me.

        Cheers,

        E.
        --
        W. Eliot Kimber, eliot@...
        Consultant, ISOGEN International

        1016 La Posada Dr., Suite 240
        Austin, TX 78752 Phone: 512.656.4139
      • markkennethjackson
        ... Here s an example of using a single item list to overlay an image (as Ken Holman mentioned). This was run with XEP 2.77.
        Message 3 of 9 , Oct 23, 2002
        • 0 Attachment
          --- In XSL-FO@y..., Anderson Chan <clt_anderson@y...> wrote:
          > Hi I wonder if xsl:fo allow text to be written across
          > an image? thanks.

          Here's an example of using a single item list to overlay an image (as Ken Holman mentioned). This was run with XEP 2.77.

          <?xml version="1.0" encoding="iso-8859-1"?>
          <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
          <fo:layout-master-set>
          <fo:simple-page-master master-name="my-page">
          <fo:region-body/>
          </fo:simple-page-master>
          </fo:layout-master-set>
          <fo:page-sequence master-reference="my-page">
          <fo:flow flow-name="xsl-region-body">
          <fo:block-container width="4in">
          <fo:block>Here is some text before the image.</fo:block>
          <fo:block>Here is some text before the image.</fo:block>
          <fo:list-block space-before="0pt" space-after="0pt" provisional-distance-between-starts="0in" provisional-label-separation="0in" space-after.optimum="0pt">
          <fo:list-item>
          <fo:list-item-label end-indent="4in">
          <fo:block>
          <fo:external-graphic content-width="4in" content-height="4in" src="url(blank-coupon.jpg)"/>
          </fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
          <fo:block margin-left="2em" margin-right="0pt" text-align="start" space-before="2em" space-before.conditionality="retain">
          This is overlay text.
          </fo:block>
          </fo:list-item-body>
          </fo:list-item>
          </fo:list-block>
          </fo:block-container>
          </fo:flow>
          </fo:page-sequence>
          </fo:root>
        • W. Eliot Kimber
          ... There s no reason in theory that you couldn t use absolutely position block containers that contained basic-link that contained blocks with explicit widths
          Message 4 of 9 , Oct 23, 2002
          • 0 Attachment
            bryan wrote:
            > I was just wondering about this, consider it a light-weight thinking
            > about the matter rather than a pressing need, but could one implement an
            > image map in xsl-fo i.e translate an well-formed html image map to a
            > structure that would function in the same way in xsl-fo? It seems to me
            > that using RenderX it might be possible considering the way linking is
            > handled, although otherwise I can't see a way.

            There's no reason in theory that you couldn't use absolutely position
            block containers that contained basic-link that contained blocks with
            explicit widths and heights to create links that happen to be positioned
            on top of an image. Should just work in any FO implementation that
            translates basic-link to PDF links. That would give you the effect of
            image map w/in PDF, at least.

            Should just work with XEP and XSL Formatter.

            Cheers,

            E.
            --
            W. Eliot Kimber, eliot@...
            Consultant, ISOGEN International

            1016 La Posada Dr., Suite 240
            Austin, TX 78752 Phone: 512.656.4139
          • W. Eliot Kimber
            ... but could one implement an ... [...] ... Here s an FO fragment that successfully creates an absolutely-positioned rectangular hot spot on a graphic. This
            Message 5 of 9 , Oct 24, 2002
            • 0 Attachment
              W. Eliot Kimber wrote:
              > bryan wrote:
              >
              but could one implement an
              >>image map in xsl-fo i.e translate an well-formed html image map to a
              >>structure that would function in the same way in xsl-fo?
              [...]
              > There's no reason in theory that you couldn't use absolutely position
              > block containers that contained basic-link that contained blocks with
              > explicit widths and heights to create links that happen to be positioned
              > on top of an image.

              Here's an FO fragment that successfully creates an absolutely-positioned
              rectangular hot spot on a graphic. This works with XSL Formatter 2.3
              producing PDF by printing to Acrobat Distiller. Should work with XEP
              except that the current version of XEP doesn't fully support absolutely
              positioned block containers, so you'd have to use different geometry
              than in this sample, at least for now (it's on their to-do list). Or you
              can use a list as discussed on the XEP support list. Haven't tried with
              Epic or FOP yet. This produces a 1in square positioned 1in down from
              the before edge of the graphic.

              <fo:block>
              <fo:block>Test of "image map" overlay on graphics</fo:block>
              <fo:block-container>
              <fo:block><fo:external-graphic content-width="scale-to-fit"
              src="url(graphics/graphic-test-01.eps)"/>
              </fo:block>
              <fo:block-container
              absolute-position="absolute"
              top="1in"
              block-progression-dimension="1in"
              inline-progression-dimension="1in"
              text-align="center" display-align="center"
              border-style="solid"
              border-width="1pt"
              border-color="red">
              <fo:block>
              <fo:basic-link internal-destination="target-1">
              <fo:block color="red" font-size="24pt" line-height="110%">
              target 1
              </fo:block>
              </fo:basic-link>
              </fo:block>
              </fo:block-container>
              </fo:block-container>
              </fo:block>
              <fo:block break-before="page">
              <fo:block id="target-1">This is target 1</fo:block>
              <fo:block id="target-2" padding-before="1in">This is target 2</fo:block>
              </fo:block>

              Cheers,

              Eliot

              --
              W. Eliot Kimber, eliot@...
              Consultant, ISOGEN International

              1016 La Posada Dr., Suite 240
              Austin, TX 78752 Phone: 512.656.4139
            Your message has been successfully submitted and would be delivered to recipients shortly.