Url link to image

We're trying to link a url to an image. Is that possible? I can make text link to a url by putting it between the cite tags. I am able to put an image between the cite tags, but clicking it on the PDF does not work. Am I doing something wrong or is it just not possible?

Parents
  • Hi Carol,

    Hard to say without some more details (psfmtdrv workflow or divpdf? image set with <ig> or <igt>?), but it may be possible with a bit of work.

    In a very general sense, what the XPP code is doing is determining a "start" x/y position (e.g. the page position of the start cite tag) and an "end" x/y position (e.g. the page position of the end cite tag) and then use those to specify a "box" that determines the "hot spot" and link that box to an action (e.g. link to a URL).

    Easy enough to imagine what's going on when you're dealing with text - where the top left of the text and the bottom right of the text determines the "hot spot box" (and the code handles making multiple "hot spot boxes" if the text is across multiple lines).

    Trying to get XPP to do something similar with an image presents some challenges.

    For example, under normal circumstances using an <ig> to set an image does no "movement" at all of the current x/y page position. So if you're just using an <ig> to set the image between the start/end cite tags, then XPP will calculate a "zero size" box and will skip generating any kind of hot spot (it will do that if either the "width" or the "depth" of the "box" is zero).

    Using <igt> does "lead" (or "move") down below the image depth and "move" to the right by the image width - but it also does some other things with quads that will probably interfere with you getting the (hot spot box) results you want.

    You'll need to see how else you can set the image in such a way that the x/y page position changes in the desired way after it (maybe an addition to what ig does) - and deal with whatever XPP thinks is the current "line leading" (i.e. ascender/descender) at the beginning and ending positions in order to get your "hot spot box" calculated where you want it over the image (i.e. the "details" of the start/end x/y page position calculations XPP is doing - think "text"). Then afterwards you'll have to deal with getting your x/y page position back to where you want it to be for what follows.

    After using <ig> (or <igt>) there are a number of system variables that will give you the image width/depth (or scaled image/width depth) which can help you to "move" the x/y page position to where you want to get it to get (closer) to the right "hot spot box" results. See the documentation for ig/igt and corresponding system variables in the XyMacros manual. For example, in it's simplest form doing <ig;image><mh;%igswidth><mb;%igsdepth> will set an image and then move the current page position down and right by the image (scaled) width and depth.

    Anyway, just some ideas.

  • I've been playing with this.

     

    for ig, mh and mv don't have an effect, even if I use a measurement instead of %. The only way to get it to not overprint text is to enter spacing after the text.

  • igt gives me space whether or not I add the mh and mv tags. Also adds a thin space. No change if I use a measurement number (such as 30q) instead of %.

    Neither one gives me a clickable link on the image.

    What am I missing here? Have I ordered the elements incorrectly?

Reply Children