Jump to content

Do not output Blank pages


scottshoaf

Recommended Posts

Here's what I used, but did not take out the blanks.

 

if(Field("CUSTOMER ID")=="");

FusionPro.Composition.SetBodyPageUsage(1,2, false);

 

Can someone tell me if the 1 and 2 I used here, actually refer to the Body 1 and Body 2 pages that I'm trying to affect?

 

Thanks

Scott Shoaf

 

FP 8.2.7

Mac OS 10.7.5

Link to comment
Share on other sites

Here's what I used, but did not take out the blanks.

 

if(Field("CUSTOMER ID")=="");

FusionPro.Composition.SetBodyPageUsage(1,2, false);

 

Can someone tell me if the 1 and 2 I used here, actually refer to the Body 1 and Body 2 pages that I'm trying to affect?

That's the wrong syntax. First, you don't want a semicolon at the end of the "if" statement; that truncates the conditional and the next line always executes. Also, you can only change the usage of one page at a time in each call to FusionPro.Composition.SetBodyPageUsage. So to disable the first two pages, you need to make two calls, like so:

if (Field("CUSTOMER ID") == "")
{
    FusionPro.Composition.SetBodyPageUsage(1, false);
    FusionPro.Composition.SetBodyPageUsage(2, false);
}

Or, you can put the condition right into the call, like so:

FusionPro.Composition.SetBodyPageUsage(1, Field("CUSTOMER ID") != "");
FusionPro.Composition.SetBodyPageUsage(2, Field("CUSTOMER ID") != "");

If you have a lot of pages, you can do this in a loop instead of adding more lines with the same call.

Link to comment
Share on other sites

Thanks for the lesson Dan. I'm a pretty green Javascript(er), however, I still do not get the results I'm needing. The blank pages still show up in the output.

 

There's alot going on here, and I may not be explaining myself clearly.

 

I tried to upload the job, but got an error.

 

Thanks for you time.

Scott

Link to comment
Share on other sites

I have page 1 set to unused, page 2 set as a overflow page, and pages 3&4 are normal body pages.

 

I have used this OnRecordStart rule

 

if (Field("CUSTOMER ID") == "")

{

FusionPro.Composition.SetBodyPageUsage(1, false);

FusionPro.Composition.SetBodyPageUsage(2, false);

}

 

I have tried both with true and false, but do not get the results I'm looking for. Either it has the summary page for page 1 and the blank pages or it has no summary page at all.

Link to comment
Share on other sites

Don,

Here's the FP template, and the two databases. Sorry I had to split them up like that with multiple zip files. Too big to send as one. The .txt file called "205104 summary.txt is used for an ExternalDataFile, the other is the source file.

 

Let me know what you think.

 

Greatly appreciate you talking a look.

 

Scott

Summary Page.pdf

205104_TEST.txt.zip

205104_summary.txt.zip

Link to comment
Share on other sites

I have page 1 set to unused, page 2 set as a overflow page, and pages 3&4 are normal body pages.

 

I have used this OnRecordStart rule

 

if (Field("CUSTOMER ID") == "")

{

FusionPro.Composition.SetBodyPageUsage(1, false);

FusionPro.Composition.SetBodyPageUsage(2, false);

}

 

I have tried both with true and false, but do not get the results I'm looking for. Either it has the summary page for page 1 and the blank pages or it has no summary page at all.

Sorry, prior to FusionPro version 8.0, the first parameter to FusionPro.Composition.SetBodyPageUsage has to be the name of a page. Only in FusionPro 8.0 and later can you use a page number. In fact, if you look in your composition log (.msg) file, you'll see a message like this:

In SetBodyPageUsage(), no page named "1"

So you need to either upgrade to FusionPro 8, or name the pages in the Page Usage dialog, and then call out the page names; something like this:

if (Field("CUSTOMER ID") == "")
{
   FusionPro.Composition.SetBodyPageUsage("Body 1", false);
   FusionPro.Composition.SetBodyPageUsage("Body 2", false);
}

Also, as the word "Body" in the function name suggests, this works only for Body pages, not for Overflow pages. So if page 2 is already an Overflow page, you can't disable it this way, but since it should have no content when page 1 is empty, it shouldn't appear anyway. So the rule can just be like so:

if (Field("CUSTOMER ID") == "")
   FusionPro.Composition.SetBodyPageUsage("Body 1", false);

Link to comment
Share on other sites

Do you have records long enough for the overflow page to be needed? I just ran the job from this new template of ther first two records and the output is 5 pages. I think it is working correctly, but don't know without a recored that would need to overflow.

 

Oh and wow, that is a complex job compared to most of mine! I wish I would get some stuff like that sometimes!!

Test_Output.pdf

Summary Page_Don_New.pdf

Edited by dreimer
Link to comment
Share on other sites

Dan,

That worked. As soon as I gave the page a name, and plugged that in, I got what I was wanting. It has created one other problem. When it returns page 1 in the output, I also need page 2 even if it's blank because of how the job will duplex. Because page 2 is a overflow page, it is not included. How would I include page 2 only when page 1 is populated?

 

Thanks so much for all your help.

 

scott

Link to comment
Share on other sites

Don,

So far I do not have any records needing the overflow page. I built it in there as kind of a safety net. The only problem I'm having now that it works correctly is that when I get page 1, I also need the overflow page even if it's blank so that it backs up correctly. I guess I will tackle that in the morning. Almost there.

 

Thanks again for your help.

 

Scott

Link to comment
Share on other sites

So far I do not have any records needing the overflow page. I built it in there as kind of a safety net. The only problem I'm having now that it works correctly is that when I get page 1, I also need the overflow page even if it's blank so that it backs up correctly. I guess I will tackle that in the morning. Almost there.

So change it back to a Body page, and add the code to enable or disable it in OnRecordStart. Turn off the Overflow on the first page. Then you can connect the frames from the two pages together into a single flow with the "Connect Text Frames" tool from the FusionPro tools in Acrobat.

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