jhudson7528 Posted November 5, 2015 Share Posted November 5, 2015 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 Quote Link to comment Share on other sites More sharing options...
step Posted November 5, 2015 Share Posted November 5, 2015 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'); Quote Link to comment Share on other sites More sharing options...
jhudson7528 Posted November 5, 2015 Author Share Posted November 5, 2015 Brilliant. Thank you. 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.