MIB Posted February 3, 2014 Share Posted February 3, 2014 Hi, I've searched the forums and still cannot find a solution or found a way to get it working. Scenario I have a 2 page PDF and I want to output 100 copies with each copy on the front page displaying a unique number ie. 1 to 100. I know I can do this very easily by connecting to a database, but there must be a simpler way to do this without creating a database each time as you can do this in PrintShop Mail without a database. Any help with this would be greatly appreciated for a Javascript newbie. Thanks in Advance! Quote Link to comment Share on other sites More sharing options...
step Posted February 3, 2014 Share Posted February 3, 2014 When defining your data source: "Specify a data source definition" Click Next "None" Click Next Click Finish Create an OnJobStart callback rule and put this in it: FusionPro.Composition.composeAllRecords = false; FusionPro.Composition.endRecordNumber = 100; // number of copies Create a blank text rule that will return the sequence number and then put it in a text frame on the first page: return FormatNumber("000",CurrentRecordNumber()); Quote Link to comment Share on other sites More sharing options...
MIB Posted February 3, 2014 Author Share Posted February 3, 2014 Many thanks Step! It worked perfectly. Quote Link to comment Share on other sites More sharing options...
johnw Posted March 21, 2014 Share Posted March 21, 2014 I'm glad I stumbled on this. It just made a job I'm working on a lot easier. Thanks! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted March 21, 2014 Share Posted March 21, 2014 You can do this without any JavaScript rules at all, if you don't need the leading zero padding in the numbers. Just set the Record Range on the Input tab of the Composition Settings dialog, and insert the $inputrecordnumber variable in a text frame. Quote Link to comment Share on other sites More sharing options...
MIB Posted March 25, 2014 Author Share Posted March 25, 2014 Having had time to look at this again, there is another simpler way than the first solution, which includes padding if you want it or not. Create/Select the "Sequential Numbering Rule" rule via Rules with the padding you want. Insert that rule into the text frame and then compose. Specify your output file and the record range via the Input tab. Quote Link to comment Share on other sites More sharing options...
Kdeligio Posted May 15, 2014 Share Posted May 15, 2014 Hi, How can you take it a step further and do this with the user inputting a start number and end number in marcom, and then having the composition generate the number of pages with that corresponding number printed on the corresponding page dynamically? ie start number 35 end number 62 Input is appreciated! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 15, 2014 Share Posted May 15, 2014 Hi, How can you take it a step further and do this with the user inputting a start number and end number in marcom, and then having the composition generate the number of pages with that corresponding number printed on the corresponding page dynamically? ie start number 35 end number 62 Input is appreciated! This is now a MarcomCentral question, which should really be asked in the MarcomCentral forum. I'm not quite sure how the numbers on the MarcomCentral input form would be applied to the composition. If the numbers are field values, then you can't use them in OnJobStart, as they are specific to a record of data. Although you might be able to do something like this in OnRecordStart: FusionPro.Composition.repeatRecordCount = Int(Field("End Number") - Int(Field("Start Number")) + 1; Then you could do this in another rule to get the sequence number: return FormatNumber("000", FusionPro.Composition.repeatRecordNumber + Int(Field("Start Number") - 1); However, I'm not sure that MarcomCentral will let you do a repeat like this. I think it has some other mechanism to do this kind of thing. That's why I would ask in the MarcomCentral forum. 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.