Jump to content

Dynamically change the graphic box within a rule?


marcuslayton

Recommended Posts

Howdy all -

 

I have a need to change the lower left (hence the height and width) based on data. They want an arrow to skew to certain locations on a map based on what state it is.

 

Is there a way to dynamically change the the lower left corner of a graphic box?

 

Other ways i may be able to get an arrow to skew to a dynamic location?

 

Thanks!

 

~Mark

Link to comment
Share on other sites

You can't currently change the position of a variable frame (graphic, text, or any other flavor) in FusionPro Desktop from a JavaScript rule. (Although, you can modify any aspect of the layout, including adding, deleting, and moving frames with the DIF Control API in FusionPro Server.)

 

However, there are some tricks you can do to make a graphic appear in a different location on a page. The most straightforward one I can think of is to use the "Left Indent" and "Space Before" attributes of the paragraph tag to offset an inline graphic in a text frame (with a text rule). For instance:

var hoffset = 3600; // hundredths of points, 7200 per inch
var voffset = 7200; // hundredths of points, 7200 per inch
return '<p leading=1><p findent=' + hoffset + ' leadbefore=' + voffset + '>' +
   Rule("MyGraphicRuleName").content;

You just need to figure out the offsets and plug them in, and change the last line to the name of your the existing graphic rule.

 

Of course, in the above logic, the "voffset" (vertical offset) is from the top of the frame to the top of the graphic, not from the bottom. But have no fear! We can also offset from the bottom of the frame. Just set the text frame to "Vertical Alignment Bottom" (click the icon at the bottom right of the Text Frame Properties palette), and do this instead:

var hoffset = 3600; // hundredths of points, 7200 per inch
var voffset = 7200; // hundredths of points, 7200 per inch
return '<p findent=' + hoffset + '>' +
   Rule("MyGraphicRuleName").content +
   '<p leadbefore=' + voffset + '>';

Alternatively, you could place the inline graphic in a table cell in a text frame, where you can offset the position of the cell by modifying column widths and cell heights and such.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...