SpencerWhetstone Posted September 24, 2008 Share Posted September 24, 2008 I have to produced a pad of pages that have sequential numbers in two columns. Consider the following example. Page 1 starts with 1 thru 10 in the first column, then jumps to the top of the next column, repeats through 20 and then creates a new page. I need to specify a starting number and and ending number and have the routine generate whatever number of pages necessary. Seems like a job for Javascript! Can anyone get me started? 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20 -----p1------- 21 31 22 32 23 33 24 34 25 35 26 36 27 37 28 38 29 39 30 40 -----p2------- 41 51 42 52 43 53 44 54 45 55 46 56 47 57 48 58 49 59 50 60 -----p3------- et cetera Thanks for any help! Spencer Link to comment Share on other sites More sharing options...
mhilger Posted September 24, 2008 Share Posted September 24, 2008 Hello Spencer, There are a couple of ways to achieve what you are after as I'm sure you can imagine. Let me explain an approach I took (see attached sample job as well): - Created data file with start and end number fields in it - Made a template with 1 body page that had 2 text frames on it - one for each column of numbers on the page - Used the FusionPro frame connector tool to connect the first frame to the second so text will overflow from the frame to frame - Inserted a new page into the template (FusionPro -> Manage Pages -> Insert Page) that was an "Overflow" type page. Set this to be a duplicate page of my body page with the 2 frames on it. - On my overflow page, I set the first frame to be the overflow destination for the page (checking the "Overflow To" checkbox on that frame) - On the body page, I set the second frame's overflow properties (accessible on the bottom-left of the frame property dialog) to be "Overflow Text to New Pages". I specified my overflow page I had created. - Created a JavaScript rule called "numbers rule" that had a simple loop in it that started at the value of the StartNum field, ended at the EndNum field value. This loop made a simple string of numbers with some logic to insert break characters. Here's the script I wrote: returnString = ''; for (x=Field("StartNum"); x<=Field("EndNum"); x++) { returnString += x; if (x<Field("EndNum")) { returnString += '<br>'; } } return returnString; - On the body page on page 1, inserted the rule "numbers rule". - Previewed the job. I saw that there were 15 numbers being displayed in the first column (the goal is to get 10 numbers in there, right?) - Went back into my first frame and increased the font size of the font that was used to typeset the numbers. Previewed again and saw 12 numbers in the frame.... Increased the point size of the text again and previewed and then I saw the 10 numbers appear (with the 11th now appearing at the top of the second column). - Composed the job and verified the output. 2 columns of numbers per page with 10 numbers in each column. First number is the startNum value in the data. Last number is the endNum value in the data. Hope this is what you were looking for, Spencer. As I mentioned, there are a number of ways to do this job (you can use tables or tabs instead of the 2 frames, different logic to create the string of numbers, maybe even something with using our imposition tool to create the pages). This method seemed fairly straight-forward so hopefully it works for you. Enjoy! --Marknumber-columns-example.zip Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.