Jump to content

Controlling width, height, and position OnRecordStart


step

Recommended Posts

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");

Link to comment
Share on other sites

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 inch

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

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