Jump to content

Insert a graphic based on the field changing


lasdoog

Recommended Posts

Hello,

 

I've found a few things in the forum about this, but no clear answer. I'm trying to mark the piece when the Tray Number changes on a postcard mailing so Bindery can quickly see where the next tray begins.

 

I've tried using this in OnRecordStart:

 

if (FieldChanged("TRAYNUMBER"))

FusionPro.Composition.SetBodyPageUsage("Break", true);

 

This does not work when used with FPImposer. I get messages like this in the log file:

 

"Composing record #12, input record 918

Sheet #5, record #4

The number of pages in this record does not match the imposition signature: 2 blank pages will be added.

A body page does not have master page assigned."

 

If I compose the file without imposition it works, BUT marks the second piece of the new tray (!?)

 

Any advice will be greatly appreciated! Thanks!

 

 

FusionPro VDP Creator 9.2.31

Mac OS 10.10.5

Edited by lasdoog
Add system info
Link to comment
Share on other sites

Well, yeah, I see why that doesn't work. You're going along making a bunch of records which all have the same number of pages, then suddenly you add a new page to a record and now you're asking FusionPro to impose a record with an extra page, but there's nowhere for it to go.

 

So we need to add this "break" marker in such a way that it doesn't change the number of output pages in a record. There are two ways I can think of to do this.

 

The first way, which I don't recommend because it's pretty complicated, is to make as many "Break" pages as there are pages in a regular output record. So if your job is set to impose four pages per record, you'll need to have four "Break" pages, named something like "Break1", "Break2", etc., then in OnRecordStart you'll need to turn on all of those pages and turn off all of the other pages, which will have to also be named something like "Regular1", "Regular2", etc. Something like this.

if (FieldChanged("TRAYNUMBER"))
{
   for (var i = 1; i <= 4; i++)
   {
       FusionPro.Composition.SetBodyPageUsage("Break" + i, true);
       FusionPro.Composition.SetBodyPageUsage("Regular" + i, false);
   }
}

The second way, which I do recommend, is to insert a slip sheet, which doesn't get imposed with the pages of any record, but actually inserts a whole new sheet between other sheets of imposed records. And the best way to accomplish that is to start a new stack when the tray number changes, then insert slip sheets between the stacks. So the OnRecordStart rule would be like so:

if (FieldChanged("TRAYNUMBER"))
   FusionPro.Composition.StartNewStack();

Then, on the Imposition tab of the Composition Settings dialog, under Slip Sheets, select "Beginning of a stack", and select your "Break" page in the other drop-down. You may want to make your "Break" page the same size as an imposed sheet, rather than the size of a page.

 

Also, you obviously have to be using stacked imposition, but that's just a simple check box in FP Imposer if you're not already doing it. (I would set the stack to Infinite in the FPI file, since you're doing what we call arbitrary stacking with the FusionPro.Composition.StartNewStack() call.)

 

If you want this to work for both imposed and non-imposed output, you can have one unused "Break" page the same size as the other pages, and another unused page called something like "BreakSlip" the size of the imposed sheet (which gets selected on that Imposition tab in the Composition Settings), and do this in OnRecordStart:

if (FieldChanged("TRAYNUMBER"))
{
   if (FusionPro.Composition.JobOptions.UseImpositionDefFile == 'Yes')
       FusionPro.Composition.StartNewStack(); // use "BreakSlip" slip sheet
   else
       FusionPro.Composition.SetBodyPageUsage("Break", true);
}

Link to comment
Share on other sites

I've found a few things in the forum about this, but no clear answer. I'm trying to mark the piece when the Tray Number changes on a postcard mailing so Bindery can quickly see where the next tray begins.

No clear answer? I thought I was pretty clear in my answer to a very similar question in this thread. The only difference is that you want to insert an extra page when the tray number changes and the original poster wanted to insert an extra page when the stack height hit 100.

 

I've tried using this in OnRecordStart:

 

if (FieldChanged("TRAYNUMBER"))

FusionPro.Composition.SetBodyPageUsage("Break", true);

 

This does not work when used with FPImposer. I get messages like this in the log file:

 

"Composing record #12, input record 918

Sheet #5, record #4

The number of pages in this record does not match the imposition signature: 2 blank pages will be added.

A body page does not have master page assigned."

 

If I compose the file without imposition it works, BUT marks the second piece of the new tray (!?)

The error you're getting is because the FP imposition you've defined is for 1 page per record but when the tray number changes you're trying to compose 2 pages per record (your postcard page and your "break" page). Instead, you need to change your logic to repeat the record twice when the tray number changes – once with the "break" page enabled (and postcard page disabled) and once with the postcard page enabled (and "break" page disabled). That will give you the results you're looking for while still conforming to the imposition you've defined for FusionPro.

 

This assumes that the "postcard" is on a body page named "postcard":

FusionPro.Composition.SetBodyPageUsage("Break", false);
if (FieldChanged("TRAYNUMBER")) {
 FusionPro.Composition.repeatRecordCount = 2;
 FusionPro.Composition.SetBodyPageUsage("Break", FusionPro.Composition.repeatRecordNumber%2 == 1);
 FusionPro.Composition.SetBodyPageUsage("postcard", FusionPro.Composition.repeatRecordNumber%2 == 0);
}

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