Search the Community
Showing results for tags 'pagecount'.
-
Adding pages to make output PDF divisible by 4
CCS_Printing posted a topic in FusionPro® VDP Creator
What I need is a bit more complex than the title suggests. There are two separate sections in this book where the client can choose 1 to 5 optional pages. Each new section needs to start on the left, so if an uneven number of pages is chosen a filler page specific to that section will need placed. After that has happened the entire book (which will always be an even number of pages at this point) will need two specific pages placed at then end if it's not divisible by four for saddle stitch. I've poured over the forums and other samples I have, but just can't quite get it working. Here are some helpful posts I referenced: Inserting Multi-page PDF variable graphics Print page depending on even or odd pages I want to make an array for each of the two sections, count those pages and activate an unused body page if the count is odd. I'm using this in an OnRecordStart rule. Here's the code I've been trying to massage, taken and modified from a sample file: var counter = 0; PAGEArray = [Field("FundCare_Orange1"), Field("Dental_Orange2"), Field("FlexSpend_Orange3"), Field("PlansWork_Orange4"), Field("HowToHSA_Orange5"), Field("ClientUpload_Orange")] var PAGECount = 0; for (i = 0 ; i < PAGEArray.length ; i++) { if (PAGEArray[i] != "") { counter++; var Pic = new FusionProResource(PAGEArray[i], "graphic", "true"); var PicPages = Pic.countPages; if (PicPages % 2 > 0) { FusionPro.Composition.SetBodyPageUsage(“Orange_Filler1”, "true"); } } } But that just activates the unused body page anytime the array is true (not empty), and I can't seem to get the countPages aspect to work. When I use Print("PAGECount is " + PAGECount) and view the log, I simply get PAGECount is 0 repeated for each of the fields in the array that's populated. As far as counting the pages of each complete record and activating the two unused body pages at the end based on whether or not it's divisible by four, I was thinking along the same lines but am not sure how to include the pages from the base template in the count, the pages that aren't part of a graphic field. Any help is really appreciated, I always try to research and resolve things on my own as it really helps me learn, but I need some tutelage here and I'm running out of time. Thanks in advance! OSX 10.10.5 Acrobat 10.1.16 FusionPro 9.3.15