Jump to content

Page Usage with existing On Record Start Rule


bkurzbuch

Recommended Posts

I'm having trouble with the syntax for a page usage rule and where to apply it. I have a 3 page document with 2 different backs. If field-2 is not blank use page back_2, if field-2 is blank use page back_1. Since you can have only 1 On Record start rule i believe. I already have a rule to suppress the first page on press output in Marcom. Listed below. Do i just add my page usage rule to it? Thanks For the help.

FusionPro.Composition.SetBodyPageUsage("front", IsPreview());

Link to comment
Share on other sites

Thank You

I've added my code to the excessing rule but am getting a syntax error on line 4 and I don't understand why. Thanks for your help.

 

FusionPro.Composition.SetBodyPageUsage("front", IsPreview());


if (Field("Imprint Line 2")) == ""
{
SetBodyPageUsage("back_1",true);
SetBodyPageUsage("back_2",false);
}
else
{
SetBodyPageUsage("back_1",false);
SetBodyPageUsage("back_2",true);
}

Link to comment
Share on other sites

Thank You

I've added my code to the excessing rule but am getting a syntax error on line 4 and I don't understand why. Thanks for your help.

 

if (Field("Imprint Line 2")) == ""

 

That line should be:

if (Field("Imprint Line 2") == "")

Or just:

if (!Field("Imprint Line 2"))

Or, rearranging a bit:

if (Field("Imprint Line 2"))
{
   FusionPro.Composition.SetBodyPageUsage("back_1", false);
   FusionPro.Composition.SetBodyPageUsage("back_2", true);
}
else
{
   FusionPro.Composition.SetBodyPageUsage("back_1", true);
   FusionPro.Composition.SetBodyPageUsage("back_2", false);
}

Or:

var imprint2 = Field("Imprint Line 2");
FusionPro.Composition.SetBodyPageUsage("back_1", !imprint2);
FusionPro.Composition.SetBodyPageUsage("back_2", imprint2);

Note that you have to call FusionPro.Composition.SetBodyPageUsage, not just SetBodyPageUsage.

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