Jump to content

Offset underline and strikethrough ?


jhudson7528

Recommended Posts

I have a document with variable page headings that have under and over lines. Sample text attached. Is it possible to offset the under and strikethrough lines to achieve the look?

 

I am open to any other suggestion.

 

Thanks

 

http://royercomm.com/sites/test/page-head1.png

http://royercomm.com/sites/test/page-head2.png

Link to comment
Share on other sites

I think what you should do is return your headers within a table. This will give you the ability to set a top and bottom margin as well as add a border to the top and bottom of the row. Using the TextMeasure functionality, you'll be able to variably set the width of the table to the width of the text within it so that the borders will match the text within it. Here's a sample:

var field = Field("YOUR FIELD HERE");
var spaceAbove = 100;
var spaceBelow = 100;

// Function to determine width of the lines based
// on the width of the text between them.
//   
//    ** Make sure the properties match
//         the text you are returning **
function getTextWidth(input){
   var tm = new FusionProTextMeasure;
   tm.font = 'Helvetica';
   tm.pointSize = "12 pt"
   tm.CalculateTextExtent(input);
   var result = tm.textWidth;
   return result;
}

// Create a table
var table = new FPTable
table.AddColumns(getTextWidth(field));
cell = table.AddRow().Cells[0];
cell.Margins = {Top: spaceAbove, Bottom: spaceBelow, Left: 0, Right: 0};
cell.VAlign = 'Middle';
cell.SetBorders('Thin', 'Black', 'Top', 'Bottom');
cell.Content = field;
return table.MakeTags().replace('<table','<table alignment=center');

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...