Jump to content

Page Usage Based on Code


bkurzbuch

Recommended Posts

I have several jobs I need to assemble like this job, so if anyone has a better way to do this please don't hesitate to speak up. FusionPro 9.3.36, Mac OS Sierra 10.12.6. I have a 80 page document of cards that are state specific. The code looks like "AZ-ART-TR-E", "CA-ART-TR-S" so on and so forth for all 40 versions. With the first 2 characters being the state and last one being English or Spanish.I have named each page with there code like this "CA-ART-TR-S Front" and "CA-ART-TR-S Back" and all are set to unused. My code is below and set for on record start, but when I preview template it is showing all pages as I scroll through instead of just the page called for by "Version". I can't see what I'm missing to get this to work. Thanks in advance for your help.

 

FusionPro.Composition.SetBodyPageUsage(Field("Version") + " Front", true);
FusionPro.Composition.SetBodyPageUsage(Field("Version") + " Back", true);

Link to comment
Share on other sites

Hi Dan

 

Thanks for the response. After further testing, yup it is working as expected both when I compose and in Marcom. Just for my own knowledge. How come it doesn't show correctly when you use the preview template palette in acrobat? I ask because I had a similar job that I used a switch rule for the pages and it showed my preview correctly. The code is below so you know what i mean. It was a smaller job with only 12 pages and it would show me a preview of the correct page and no preview if not. As always thank you very much for your time. Great appreciatied.

 

switch (Field("Letter Type"))
{
 case "ARNOT18 YP1 ACH-CC SNGL T":
   FusionPro.Composition.SetBodyPageUsage("1",true);
   FusionPro.Composition.SetBodyPageUsage("2",true);
   break;
 case "ARNOT18 YP1 ACH-CC INST T":
   FusionPro.Composition.SetBodyPageUsage("3",true);
   FusionPro.Composition.SetBodyPageUsage("4",true);
   break;
 case "ARNOT18 PHY-RES ACH-CC SNGL":
   FusionPro.Composition.SetBodyPageUsage("5",true);
   FusionPro.Composition.SetBodyPageUsage("6",true);
   break;
   case "ARNOT18 PHY-RES ACH-CC INST":
   FusionPro.Composition.SetBodyPageUsage("7",true);
   FusionPro.Composition.SetBodyPageUsage("8",true);
   break;
   case "ARNOT18 PHY ACH-CC INST T":
   FusionPro.Composition.SetBodyPageUsage("9",true);
   FusionPro.Composition.SetBodyPageUsage("10",true);
   break;
   case "ARNOT18 PHY ACH-CC SNGL T":
   FusionPro.Composition.SetBodyPageUsage("11",true);
   FusionPro.Composition.SetBodyPageUsage("12",true);
   break;
 default:
   ReportError("Can't set pages for Letter Type: " + Field("Letter Type"));
}

Link to comment
Share on other sites

After further testing, yup it is working as expected both when I compose and in Marcom. Just for my own knowledge. How come it doesn't show correctly when you use the preview template palette in acrobat? I ask because I had a similar job that I used a switch rule for the pages and it showed my preview correctly.

I try to avoid using words like "correctly" and "incorrectly", or phrases like "it didn't work," because they're not very specific. What exactly was different in how the previewed pages were displayed between the two jobs? This may be a case where a picture is worth a thousand words. (Specifying the versions of FusionPro, Acrobat, and your operating systems can be helpful as well.)

The code is below so you know what i mean. It was a smaller job with only 12 pages and it would show me a preview of the correct page and no preview if not.

The way this works in local Previews (in Acrobat) is that, for a page which is unused, you will see the static background of the page, but none of the variable content (from FusionPro frames). So I'm guessing that the difference between your two jobs is that one doesn't really have any static background, and the other does. But it's just a guess without seeing anything about either job, other than the few lines of code you've posted.

As always thank you very much for your time. Great appreciatied.

No problem.

 

I'll also add a note about this code:

switch (Field("Letter Type"))
{
 case "ARNOT18 YP1 ACH-CC SNGL T":
   FusionPro.Composition.SetBodyPageUsage("1",true);
   FusionPro.Composition.SetBodyPageUsage("2",true);
   break;
 case "ARNOT18 YP1 ACH-CC INST T":
   FusionPro.Composition.SetBodyPageUsage("3",true);
   FusionPro.Composition.SetBodyPageUsage("4",true);
   break;
 case "ARNOT18 PHY-RES ACH-CC SNGL":
   FusionPro.Composition.SetBodyPageUsage("5",true);
   FusionPro.Composition.SetBodyPageUsage("6",true);
   break;
   case "ARNOT18 PHY-RES ACH-CC INST":
   FusionPro.Composition.SetBodyPageUsage("7",true);
   FusionPro.Composition.SetBodyPageUsage("8",true);
   break;
   case "ARNOT18 PHY ACH-CC INST T":
   FusionPro.Composition.SetBodyPageUsage("9",true);
   FusionPro.Composition.SetBodyPageUsage("10",true);
   break;
   case "ARNOT18 PHY ACH-CC SNGL T":
   FusionPro.Composition.SetBodyPageUsage("11",true);
   FusionPro.Composition.SetBodyPageUsage("12",true);
   break;
 default:
   ReportError("Can't set pages for Letter Type: " + Field("Letter Type"));
}

Like most cases of this, the rule doesn't really need to be any longer than two or three lines. If you name your pages after the field values, such as "ARNOT18 YP1 ACH-CC SNGL T-Front", ""ARNOT18 YP1 ACH-CC SNGL T-Back", "ARNOT18 YP1 ACH-CC INST T-Front", "ARNOT18 YP1 ACH-CC INST T-Back", etc., then the whole rule can just be this:

var page = Field("Letter Type");
FusionPro.Composition.SetBodyPageUsage(page + "-Front", true);
FusionPro.Composition.SetBodyPageUsage(page + "-Back", true);

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