Thursday, November 9

Hyperlink locations are off

I have received a number of reports of mis-aligned hyperlinks within the swipr-generated output. (BTW, I need a good name for this output, anybody got any ideas?). The problems can be traced back to two seperate causes.

Cause 1: Text objects are extending beyond the exported image.
If you select all objects in the page, you will notice pink outlines for all objects. See if you can determine the left and top edges of the exported image (compare it to the wireframe image), and then check if there are objects extending to the left and/or top of those edges. If any of the objects extending these edges are NOT on the 'no_export' layer, you have found your problem. This is normally caused by text objects that have a non-text part of the object extending above or to the left of the image. make sure all borders of text objects fall within the visible edges of the epxorted image.

A quick insight into how swipr creates the imagemap file that sets the hyperlinks:

  1. Determine the upper left corner of exportable objects - For the current page, and all of its background pages, determine the upper left-most object. For text objects, this is the left top corner of the object, which is not necessarily the left top corner of the text itself;
  2. Find hyperlink objects - cycle through the objects on the current page and all background pages to find objects on the prototype layer and the comment icon layer
  3. Calculate location of hyperlinks - do some complicated calculations to convert internal Visio-based (bottom-left) locations to pixel-based (top-left) locations and dimensions;
  4. Write imagemap file - write this information to a javascript file to include in the wireframe popup.
In the first step, you see the left top location is calculated on the basis of a text object's location and size. However, when Visio exports images, it will only export the visible portion of a Visio page. This means that there is a differnece between the calculated left top corner and the actual exported left top corner of the image, when a text object stretches beyond the visible left or top border.



So, make sure all text objects are within the visible borders of the exported image, either by moving them, or by extending the exported image to include the full text object.

Cause 2: A non-standard DPI setting of the computer's display
A new problem that came to my attention this week is when the computer display's DPI setting (the resolution) is set to a nonstandard amount (120 dpi instead of the standard 96 dpi, for instance). Swipr does not react nicely to this. The screenflow part of the export is fine, it has taken the dpi setting into account, but the wireframe output does not take that into account.

For now, the only work-around is to do the swipr output generation on a machine with standard dpi settings.

I hope this solves some of your problems!

1 comment:

Roland said...

For the output, we have started using SWIPR Flow .

Not the most original name, but people understand what we mean.