View Full Version : Controlling width, height, and position OnRecordStart

October 22nd, 2012, 07:14 AM
I thought I remembered seeing somewhere on the forum that it is possible to control the width, height, and position of a text or graphic frame on a per record basis via the OnRecordStart callback in FP8. Can someone expand on that? Or think of some way I could achieve that?

Here's my scenario:
I have variable disclaimer copy that moves per version but it uses the same rules. What I am envisioning is something like this:

var xPos = Field("xPos");
var yPos = Field("yPos");
var width = 6; // width in inches
var height = 1; // height in inches

FindTextFrame("disclaimer",xPos,yPos,width,height,).content = Field("disclaimer");

Dan Korn
October 22nd, 2012, 07:41 AM
The FindTextFrame function takes only a single parameter, the frame name. Once you have the frame object, you can modify various properties of it, including width, height, position, and a lot more, in OnRecordStart, like so:
var myFrame = FindTextFrame("disclaimer");
myFrame.x = Int(Field("xPos")) * 7200;
myFrame.y = Int(Field("yPos")) * 7200;
myFrame.width = 6 * 7200; // 6 inches
myFrame.height = 7200; // 1 inchTo see all of the properties, take a look at the Building Blocks dialog, on the Objects tab, under Frames. The "(generic frame properties)" node contains all properties common to text and graphic frames, while the other nodes contain properties specific to text or graphic frames.

Note that the units are all in hundredths of points (7200 per inch).

Also note that setting the x, y, width, height, and rotation properties is possibly only with a FusionPro VDP Producer (FP Direct or FP Server) license. If you only have a Creator (Desktop) or Designer license and you set any of the Producer-only properties, then you will get a random border and fill on the frame. However, even if you don't have a Producer license locally, the template will compose correctly when uploaded to a system using FP Producer, such as a web-to-print system like DSF or MarcomCentral.