AFitz Posted April 11, 2022 Share Posted April 11, 2022 I'm hoping you can help me! I have a project where I need to be able to print a label with variable information to be adhered to a booklet we have in inventory. My end users will be ordering this "label" through our MarcomCentral store-front, but I want them to be able to preview the entire booklet at the time the variable label is composed, and then only send the label page to the printer. So, attached is the collect file. I want the preview to display pages 1-21 and to send page 22 to the printer. (I renamed pages 21 and 22 to "Rep" and "RepLabel" in the collect.) Here's my OnRecordStart rule that I've landed on (I've tried many variations trying to get this to work): onlinePreviewVal = FusionPro.Composition.JobOptions.IsOnlinePreview; if (onlinePreviewVal=="Yes") { FusionPro.Composition.SetBodyPageUsage("1", true); FusionPro.Composition.SetBodyPageUsage("2", true); FusionPro.Composition.SetBodyPageUsage("3", true); FusionPro.Composition.SetBodyPageUsage("4", true); FusionPro.Composition.SetBodyPageUsage("5", true); FusionPro.Composition.SetBodyPageUsage("6", true); FusionPro.Composition.SetBodyPageUsage("7", true); FusionPro.Composition.SetBodyPageUsage("8", true); FusionPro.Composition.SetBodyPageUsage("9", true); FusionPro.Composition.SetBodyPageUsage("10", true); FusionPro.Composition.SetBodyPageUsage("11", true); FusionPro.Composition.SetBodyPageUsage("12", true); FusionPro.Composition.SetBodyPageUsage("13", true); FusionPro.Composition.SetBodyPageUsage("14", true); FusionPro.Composition.SetBodyPageUsage("15", true); FusionPro.Composition.SetBodyPageUsage("16", true); FusionPro.Composition.SetBodyPageUsage("17", true); FusionPro.Composition.SetBodyPageUsage("18", true); FusionPro.Composition.SetBodyPageUsage("19", true); FusionPro.Composition.SetBodyPageUsage("20", true); FusionPro.Composition.SetBodyPageUsage("Rep", true); } else { FusionPro.Composition.SetBodyPageUsage("RepLabel", true); } This still isn't resulting in what I want though. Can you help me? FusionPro Version: VDP Producer 12.1.2Rep Booklet with Label.zip Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted April 12, 2022 Share Posted April 12, 2022 Afritz, You need to make all your pages unused and then change your OnRecordStart rule to this: //access the "isOnlinePreview" property and the "isPreview" property Graphic onlinePreviewVal = FusionPro.Composition.JobOptions.IsOnlinePreview; if (onlinePreviewVal=="Yes") { for (i=1; i<=20; i++) { FusionPro.Composition.SetBodyPageUsage(i, true); } FusionPro.Composition.SetBodyPageUsage("Rep", true); } else { FusionPro.Composition.SetBodyPageUsage("RepLabel", true); } Jon Quote Link to comment Share on other sites More sharing options...
AFitz Posted May 2, 2022 Author Share Posted May 2, 2022 Thanks, Jon! And sorry for the delayed response, I didn't get notified that you responded. Unfortunately, that still only resulted in the label page being previewed within the Marcom Admin tool. See revised collect attached. Did I miss something else? Amber Booklet with Label_Preview and Print.zip Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 5, 2022 Share Posted May 5, 2022 I think the problem is on the first line of your rule: onlinePreviewVal = FusionPro.Composition.JobOptions.IsOnlinePreview; It should be: onlinePreviewVal = FusionPro.Composition.JobOptions.isOnlinePreview; Note the lower-case "i" at the start of the property name isOnlinePreview. Or better yet, remove that line completely and make the next line this: if (IsOnlinePreview()) While CFG settings are case-insensitive, JavaScript properties, such as of the FusionPro.Composition.JobOptions object, are named case-sensitively, so upper-case vs. lower-case is significant. Calling the built-in global function IsOnlinePreview() instead is better, as it insulates you from having to know the internals of the CFG file and its settings and values. Quote Link to comment Share on other sites More sharing options...
AFitz Posted May 16, 2022 Author Share Posted May 16, 2022 Awesome!! That worked! Thank you so much! This is going to make a lot of people very happy... Quote Link to comment Share on other sites More sharing options...
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.