Jump to content

Rule needed for graphic line to extend the width of Clinic name


barbschn

Recommended Posts

Posting a picture would help a ton. Is the line an inline graphic? Is the clinic name meant to flow with any other text that my surround it?

 

You could set the width of an inline graphic to match the width of the text using the TextMeasure feature.

 

You could the text in a table cell with a bottom-border.

 

A simpler solution would be to underline the variable in the text editor or using the "<u>" tags.

Link to comment
Share on other sites

Here's a TextMeasure example:

var field = Field("clinic"); // Your field goes here.
var graphic = '/path/to/your/graphic.jpg';
var graphicHeight = 1; // Height of your line (in points)
var font = {
   face: "Helvetica", // Replace with your font
   size: 15 // Replace with your font size (in points)
}

// Tag the text for text measure
var tags = '<span font="' + font.face + '" pointsize="' + font.size + '">';
field = tags + field + '</span>';

// Get the text width
function getTextWidth(input){
   var tm = new FusionProTextMeasure;
   tm.useTags = true;
   tm.CalculateTextExtent(input);
   return tm.textWidth;
}

// return field with a break (<br>) and the graphic
return field + '<br><graphic file="' + graphic + '" width="' + getTextWidth(field) + '" height="' + (graphicHeight*100) + '">';

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...