scottws Posted December 10, 2013 Share Posted December 10, 2013 1.85" x 6" tickets, 5000 run imposed 20 per 19" x 13" sheet. Run would be 250 imposed sheets. 5 different tickets, numbering on the front. Fronts would be: #1 red #3 green #5 cyan #7 blue #9 black #3 red #5 green #7 cyan #9 blue #11 black etc. and then numbers ascending, using the same sequence of backgrounds Attachment represents top sheet of press run. Where do I start to configure a rule to advance the numbers as per sample? Quote Link to comment Share on other sites More sharing options...
step Posted December 10, 2013 Share Posted December 10, 2013 The way I would do this is set up a graphic frame as the background for the ticket and name it "Background." Then I would set up two text frames, 1 for the page number and 1 for the sequence number, calling them "PageNumber" and "Seq" respectively. And assign the values/content to each of those frames via the OnRecordStart Callback rule. I was unsure if you're populating your the ticket number (i.e. the "Seq" text frame in this scenario) from a 5000 record data file or if you weren't using a data file at all and were just repeating a record 5000 times. I wrote this code assuming it was the former: var page = [["1","Red"],["3","Green"],["5","Cyan"],["7","Blue"],["9","Black"]]; // Page Number and associated background color var ticketsPerPage = 1000; // 1-1000 var numberOfPages = page.length; // 1, 3, 5, 7, 9 var seq = FusionPro.Composition.inputRecordNumber; var pageNum = "Page " + page[Math.floor(seq / (ticketsPerPage + 1 / numberOfPages))][0]; var color = page[Math.floor(seq / (ticketsPerPage + 1 / numberOfPages))][1]; FindTextFrame("PageNumber").content = pageNum; FindTextFrame("Seq").content = seq; FindGraphicFrame("Background").fillColorName = color; I created an array called "page" containing the value for the page number and the background color associated with that page number. As the code runs, the position of the array changes based on the record number (record 1001 advances to the second position of the array, etc). Of course if you'd rather just have 5 background images that already said "Page x" on them you could simplify the code to this: var page = ["1","3","5","7","9"]; // Page Number and associated background color var ticketsPerPage = 1000;// 1-1000 var numberOfPages = page.length; // 1, 3, 5, 7, 9 var seq = FusionPro.Composition.inputRecordNumber; var background = page[Math.floor(seq / (ticketsPerPage + 1 / numberOfPages))] + ".pdf"; FindTextFrame("Seq").content = seq; FindGraphicFrame("Background").SetGraphic("path/to/graphics/" + background); // Assuming your files are called "1.pdf", "3.pdf", etc And lastly, if you are repeating 1 record 5000 times rather than 5000 records 1 time, you'll need to replace "FusionPro.Composition.inputRecordNumber" with "FusionPro.Composition.repeatRecordNumber". Quote Link to comment Share on other sites More sharing options...
scottws Posted December 10, 2013 Author Share Posted December 10, 2013 Working on that now, we'll see if I can pull it off. I really appreciate the help for a n00b here. Thanks a lot. Quote Link to comment Share on other sites More sharing options...
scottws Posted December 10, 2013 Author Share Posted December 10, 2013 I used the colors just as identifiers on the example. The actual job had 5 different fronts, with different copy. How would I swap those out in the rule? Quote Link to comment Share on other sites More sharing options...
step Posted December 10, 2013 Share Posted December 10, 2013 Sound like you want to pull in different backgrounds every 1000 records like I mentioned here: Of course if you'd rather just have 5 background images that already said "Page x" on them you could simplify the code to this: var page = ["1","3","5","7","9"]; // Page Number and associated background color var ticketsPerPage = 1000;// 1-1000 var numberOfPages = page.length; // 1, 3, 5, 7, 9 var seq = FusionPro.Composition.inputRecordNumber; var background = page[Math.floor(seq / (ticketsPerPage + 1 / numberOfPages))] + ".pdf"; FindTextFrame("Seq").content = seq; FindGraphicFrame("Background").SetGraphic("path/to/graphics/" + background); // Assuming your files are called "1.pdf", "3.pdf", etc You can add the file name's of those backgrounds to the array and modify the code to look like this: // File names for your 5 fronts var page = [ "background1.pdf", "background2.pdf", "background3.pdf", "background4.pdf", "background5.pdf" ]; var ticketsPerPage = 1000;// 1-1000 var numberOfPages = page.length; var seq = FusionPro.Composition.inputRecordNumber; var background = page[Math.floor(seq / (ticketsPerPage + 1 / numberOfPages))]; FindTextFrame("Seq").content = seq; FindGraphicFrame("Background").SetGraphic("path/to/graphics/" + background); Quote Link to comment Share on other sites More sharing options...
scottws Posted December 11, 2013 Author Share Posted December 11, 2013 << And assign the values/content to each of those frames via the OnRecordStart Callback rule.>> I'm really at a loss doing this. I see there are online training modules. Which ones would address this type of coding situation? We have several variations of number schemes I need to generate. Quote Link to comment Share on other sites More sharing options...
step Posted December 11, 2013 Share Posted December 11, 2013 This is where the values are assigned to the frame: FindTextFrame("Seq").content = seq; Is your text frame named "Seq"? Did you put the code in the OnRecordStart Callback? What do you mean by "several variations of number schemes?" I'm starting to feel like I don't have enough information about what you're trying to do to help you. Can you collect your job, sample data, and post it to this thread with a better explanation so that I, or someone else, can get a better idea? Quote Link to comment Share on other sites More sharing options...
scottws Posted December 11, 2013 Author Share Posted December 11, 2013 Attached is the front page for a 1000-ticket run. This has only 1 front. Many have 5 different fronts in this sequence on the press sheet. 1 1 2 2 3 3 4 5 5 1 1 2 2 3 3 4 5 5 Quote Link to comment Share on other sites More sharing options...
dreimer Posted December 11, 2013 Share Posted December 11, 2013 Why wouldn't you just set it up as one up? Create a data file to call in the different backs and corresponding sequence numbers and just use an imposition file. Unless I am missing something. Quote Link to comment Share on other sites More sharing options...
scottws Posted December 11, 2013 Author Share Posted December 11, 2013 (edited) Some days I have 40-50 ticket jobs to do. It seemed that I could save my pdf and use as a master, with all the rules and data in place, it would speed things up. I could just import the data from one file to the next. Also, I have to do an OnJobStart rule to place the bleed on the background page, since I apparently can't do a bust-cut with bleed. Re-using a file saves me recreating the background page every time. I saw no way to import a template page from one file to another. Edited December 11, 2013 by scottws clarity Quote Link to comment Share on other sites More sharing options...
scottws Posted December 11, 2013 Author Share Posted December 11, 2013 Here's the collect for the sample I posted. Quote Link to comment Share on other sites More sharing options...
dreimer Posted December 11, 2013 Share Posted December 11, 2013 Some days I have 40-50 ticket jobs to do. It seemed that I could save my pdf and use as a master, with all the rules and data in place, it would speed things up. I could just import the data from one file to the next. Also, I have to do an OnJobStart rule to place the bleed on the background page, since I apparently can't do a bust-cut with bleed. Re-using a file saves me recreating the background page every time. I saw no way to import a template page from one file to another. When you define your data you can use the option of "Import a data source from another document". Load the .def file from your template. Then once that is done go to FusionPro on the toolbar go to advanced and import. Select your template PDF. You will now have all your rules, resources, text boxes, etc. Quote Link to comment Share on other sites More sharing options...
step Posted December 11, 2013 Share Posted December 11, 2013 Am I missing something? The sample you posted does not in any way illustrate what you said you were trying to accomplish. All of the fronts are exactly the same. Quote Link to comment Share on other sites More sharing options...
scottws Posted December 11, 2013 Author Share Posted December 11, 2013 Had I been able to produce the file I described, I would not be posting. The sample represents how I do and single-background ticket. Quote Link to comment Share on other sites More sharing options...
scottws Posted December 11, 2013 Author Share Posted December 11, 2013 OK, I see where I can import the background page. That's a start. Quote Link to comment Share on other sites More sharing options...
dreimer Posted December 11, 2013 Share Posted December 11, 2013 I would just have pages 1 and 2 as blank pages and use graphic switches based on the data to pull the different versions of art. This is not the speedy solution you are looking for, but I can't write JavaScript like some others here. Ste seems to have an idea on how to do it though. Quote Link to comment Share on other sites More sharing options...
step Posted December 11, 2013 Share Posted December 11, 2013 I would just have pages 1 and 2 as blank pages and use graphic switches based on the data to pull the different versions of art. Yes, this is what I suggested and even posted code to accomplish this. Not sure how else to help. Good luck! Quote Link to comment Share on other sites More sharing options...
scottws Posted December 14, 2013 Author Share Posted December 14, 2013 Here's a test file I set up - 3 different backgrounds. Works OK but I don't see how to repeat the sequence past the first 3. Quote Link to comment Share on other sites More sharing options...
step Posted December 16, 2013 Share Posted December 16, 2013 As I said before, the rule needs to go in an OnRecordStart Callback rule. Not an OnJobStart callback rule. And if you didn't build your quantities into your data, which it appears that you have not, you need to modify the code as I stated in my first post: And lastly, if you are repeating 1 record 5000 times rather than 5000 records 1 time, you'll need to replace "FusionPro.Composition.inputRecordNumber" with "FusionPro.Composition.repeatRecordNumber". So the OnRecordStart code would look like this: var page = [ "1.pdf", "2.pdf", "3.pdf" ]; var ticketsPerPage = 48; var numberOfPages = page.length; FusionPro.Composition.repeatRecordCount = ticketsPerPage; var seq = FusionPro.Composition.repeatRecordNumber; var background = page[Math.floor(seq / (ticketsPerPage + 1 / numberOfPages))]; FindTextFrame("Seq").content = seq; FindGraphicFrame("front").SetGraphic("/Users/sackett/Desktop/FP12-12/" + background); 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.