bkurzbuch Posted June 10, 2016 Share Posted June 10, 2016 I'm trying to center a inline graphic vertically to the text with no luck. Code is below. To have control over the vertical alignment should I use a subscript ratio instead and how would I add that. Currently the graphic is aligned baseline with the tex. Thanks for the help. return Resource("Check Box") ;alignv="Center"; Quote Link to comment Share on other sites More sharing options...
step Posted June 10, 2016 Share Posted June 10, 2016 I don't think you can superscript graphic files. You could, however, put your content in a table with two columns. The left column could be set to the width of your check box graphic and the right column could have a width of the remaining width of the text frame. Both cells in the row would be given a vertical alignment of "middle" so that the check box floats in the middle of the text. This would also give you a little more flexibility if you wanted to adjust the spacing between the checkbox and the text – you could just make the checkbox column wider. var checkbox = Resource('Check Box'); var txt = Field('Your field'); var checkboxWidth = 3000; // in 1/100 pts -> 7200 = 1" var frameWidth = FusionPro.inValidation ? 14400 : GetSettableTextWidth(FindTextFrame(FusionPro.Composition.CurrentFlow.name)); var table = new FPTable(); table.AddColumns(checkboxWidth, frameWidth-checkboxWidth); var row = table.AddRow(); var cell = row.Cells[0] cell.VAlign = 'Middle'; row.CopyCells(0,1); row.SetContents(checkbox, txt); return table.MakeTags(); "Re-evaluate this rule for every text flow" and "Treat strings as tagged text" need to be checked in the rule editor. You'll also need to name your text frame. On the other hand, if you set the width of the text frame yourself (in 100th's of a point), you don't need to name the frame or select "Re-evaluate this rule for every text flow": var checkbox = Resource('Check Box'); var txt = Field('Your field'); var checkboxWidth = 3000; // in 1/100 pts -> 7200 = 1" var frameWidth = 14400; // 14400 = 2" var table = new FPTable(); table.AddColumns(checkboxWidth, frameWidth-checkboxWidth); var row = table.AddRow(); var cell = row.Cells[0] cell.VAlign = 'Middle'; row.CopyCells(0,1); row.SetContents(checkbox, txt); return table.MakeTags(); 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.