scottshoaf Posted February 26, 2013 Share Posted February 26, 2013 I have a 4 page template, that during composition will return data on pages 1 and 2 for record 1 and then for subsequent records (say 2-7) will be blank. How do I keep the blank pages from becoming part of my output file. Thanks. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 26, 2013 Share Posted February 26, 2013 This is exactly what Overflow Pages are for. Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 Yes, but what about in the case where a page is not an overflow page. Page 1 of the document is not an overflow page, and it is not always populated with data. So in those instances, I do not want the blank pages in the output. Thanks Scott Quote Link to comment Share on other sites More sharing options...
dreimer Posted February 26, 2013 Share Posted February 26, 2013 (edited) You could make them unused body pages and build the OnRecordStart rule to call pages based on data, if I understand the question correctly. Edited February 26, 2013 by dreimer Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 Thanks Don, I will try that. Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 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 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 26, 2013 Share Posted February 26, 2013 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. Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 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 Quote Link to comment Share on other sites More sharing options...
dreimer Posted February 26, 2013 Share Posted February 26, 2013 Did you change the pages to unused? Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 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. Quote Link to comment Share on other sites More sharing options...
dreimer Posted February 26, 2013 Share Posted February 26, 2013 Not sure without seeing it and I know they are having problems with uploads. I don't think you want the page two as a overflow with the rule as it is. Change Page 2 to unused body as well and see how that works. Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 Ok tried that and regardless whether it was set to true or false, I did not get the summary page at all. It would be helpful if I could upload this. Maybe they'll get it fixed later. Quote Link to comment Share on other sites More sharing options...
dreimer Posted February 26, 2013 Share Posted February 26, 2013 Doubt the upload will be fixed any time soon, it has been a problem for awhile now. What kind of errors do you get? Can you upload a small portion of the data and the template itself. No need to collect it and upload. Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 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. ScottSummary Page.pdf205104_TEST.txt.zip205104_summary.txt.zip Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 26, 2013 Share Posted February 26, 2013 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); Quote Link to comment Share on other sites More sharing options...
dreimer Posted February 26, 2013 Share Posted February 26, 2013 (edited) It looks to work on mine, I actually named the pages and changed the OnRecordStart. See if it works for you. Not sure what page two should be though, it looks like page 1 and 2 are the same. I think that is where you were trying the overflow.Summary Page_Don.pdf Edited February 26, 2013 by dreimer Quote Link to comment Share on other sites More sharing options...
dreimer Posted February 26, 2013 Share Posted February 26, 2013 (edited) 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.pdfSummary Page_Don_New.pdf Edited February 26, 2013 by dreimer Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 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 Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 Don, Yes as soon as I named the pages, it worked. Thanks alot for your help! scott Quote Link to comment Share on other sites More sharing options...
scottshoaf Posted February 26, 2013 Author Share Posted February 26, 2013 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 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 26, 2013 Share Posted February 26, 2013 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. Quote Link to comment Share on other sites More sharing options...
dreimer Posted February 27, 2013 Share Posted February 27, 2013 It seems like it would be easier to build the first two pages in a table. I have never tried what Dan suggested as to linking the text boxes, that may be easier at this point now. Good luck. 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.