barbschn Posted April 22, 2015 Share Posted April 22, 2015 I have 500 different clinic names that are variable in a template. There is a graphic line underneath the clinic name that must extend or shrink based on width of clinic name. Any help is appreciated! Quote Link to comment Share on other sites More sharing options...
step Posted April 22, 2015 Share Posted April 22, 2015 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. Quote Link to comment Share on other sites More sharing options...
barbschn Posted April 22, 2015 Author Share Posted April 22, 2015 posted pic. would need help with text measure feature. Quote Link to comment Share on other sites More sharing options...
step Posted April 22, 2015 Share Posted April 22, 2015 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) + '">'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.