Olivier Posted May 28, 2013 Posted May 28, 2013 Hi everybody, I am looking for a way to measure the necessary height of a text frame and adapt it depending on the content the final user will put in MarcomCentral's Store. Is it possible to use the function call FusionProTextMeasure ? May someone have produced some template like this ? Many thanks for help Olivier Using FP VDP 9.0.3, AcrobatPro 9 and MarcomCentraladapted-texte-frame-height.pdf Quote
Dan Korn Posted May 28, 2013 Posted May 28, 2013 Put the text into a table, either with a single cell with lines broken up by <br> tags, or with one row for each line of text. Set the shading and borders on the table with tags or the FPTable object. Quote
Olivier Posted May 29, 2013 Author Posted May 29, 2013 Thank you Dan, but I don't see the way to know how many lines the table will have, I don't know what the final user will have to place in MCC's Store . Any example ? Regards, Olivier Quote
Dan Korn Posted May 29, 2013 Posted May 29, 2013 Thank you Dan, but I don't see the way to know how many lines the table will have, I don't know what the final user will have to place in MCC's Store . That doesn't matter. You don't need to know how many lines there will be. You can just put all the text into a table with a single cell, and the height of the cell (actually the table row) will automatically grow as large as needed to fit the text.Any example ? Something like this: var table = new FPTable; table.AddColumns(12000); table.AddRows(1); var theCell = table.Rows[0].Cells[0]; theCell.SetBorders("Thin", "Cyan", "Top", "Bottom", "Left", "Right"); theCell.ShadeColor = "Yellow"; theCell.ShadePct = 100; theCell.Content = "Here is some text with multiple lines.<br>Line 2<br>Line 3"; return table.MakeTags(); If you already have the contents of the text frame built up in the Text Editor, you can copy-and-paste it all into a new Formatted Text Resource, and then call out that resource from the rule, like so: var table = new FPTable; table.AddColumns(12000); table.AddRows(1); var theCell = table.Rows[0].Cells[0]; theCell.SetBorders("Thin", "Cyan", "Top", "Bottom", "Left", "Right"); theCell.ShadeColor = "Yellow"; theCell.ShadePct = 100; theCell.Content = Resource("Resource1").content; return table.MakeTags(); Quote
Olivier Posted May 31, 2013 Author Posted May 31, 2013 Many thanks Dan, it is working fine !!! All the best, Olivier Quote
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.