DDITC Posted August 8, 2013 Share Posted August 8, 2013 Hello, I need to create a kind of personnalized calendar from a multiple page PDF. The datas will be 1) DATE, 2) type of event,3) text, ... I need to insert these datas at the correct place on the output document. The rule will first determine which page of the PDF corresponds to the DATE data, then insert in that page the variable text. How can I make FP insert a specific variable text in a specific page of the document ? Thank for your support. Actually I'm using FP 8.2 Best regards, Quote Link to comment Share on other sites More sharing options...
step Posted August 8, 2013 Share Posted August 8, 2013 What is the end result? One calendar with all of the dates and events listed? Can you post a sample of what you're trying to achieve and maybe the files that you're working with so that we can have a better idea of what you're working with? It sounds like you'll have to link to your data file as an external data file so that you can produce every record on one calendar. Then you'll want to have pages and text frames named by date and you can populate them in an OnRecordStart Rule based on the date field. Quote Link to comment Share on other sites More sharing options...
DDITC Posted August 8, 2013 Author Share Posted August 8, 2013 Hi Step, thanks for your reply. The end result should be one calendar with all dates & events listed. I cannot send you the PDF ( 80 Mo) but I can give an exemple of the data file. date Type Detail 1 Birthday Pierre 38 Wedding Paul 40 Birthday Jacques 210 Party Martine In that example, the date represents the day number in the year. That number will be used to determine the week, then the page and the column in the page ( one per day). In fact each week uses 2 pages on the same model: left: from Monday to Thursday & Sunday Right: Friday & Saturday So determining the page & place will be an easy thing. Thus, yes, the rule will be an OnrecordStart type; I'll need to class record and get them sorted but that's for next step. First I need to bring the correct frame at the right place in the PDF. I've found informations on tags and where on the page to bring it; but not on how to bring it to the right page. Quote Link to comment Share on other sites More sharing options...
step Posted August 8, 2013 Share Posted August 8, 2013 So in your example "Date" 1 is a January 1st and "Date" 38 is February 7th? Is this a 2014 calendar? I guess one way to do it (though it's going to be a pain to set up) is to create 365 text frames named in accordance to the "Date" field. Pull in your data file as an external data file, and create an array of your data and populate the text frames as you step through the array. For example: var exData = new ExternalDataFileEx("SampleData.csv",","); var date = []; var type = []; var detail = []; for (var i = 1; i<=exData.recordCount; i++){ date.push(exData.GetFieldValue(i, "date")); type.push(exData.GetFieldValue(i, "Type")); detail.push(exData.GetFieldValue(i, "Detail")); } for (var n = 0; n<exData.recordCount; n++) { FindTextFrame(date[n]).content = type[n] + '<br>' + detail[n]; } Quote Link to comment Share on other sites More sharing options...
DDITC Posted August 8, 2013 Author Share Posted August 8, 2013 Dear Step, thanks for the method. I'll make some tests and got back to you ASAP. Best regards, Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 8, 2013 Share Posted August 8, 2013 (edited) I guess one way to do it (though it's going to be a pain to set up) is to create 365 text frames named in accordance to the "Date" field. Pull in your data file as an external data file, and create an array of your data and populate the text frames as you step through the array. That sounds like a nightmare, in terms of both maintainability and composition speed. I would just use a single-page template, and set the repeat count for the single record to 365, like a ticketing job, and then in OnRecordStart, look up and see if you have an entry in the data for that date, based on the repeat number, which is the key field in the data. Edited August 8, 2013 by Dan Korn 265 -> 365 Quote Link to comment Share on other sites More sharing options...
step Posted August 8, 2013 Share Posted August 8, 2013 That sounds like a nightmare, in terms of both maintainability and composition speed. Yeah I admitted that it probably wasn't the quickest solution. I would just use a single-page template, and set the repeat count for the single record to 365, like a ticketing job, and then in OnRecordStart, look up and see if you have an entry in the data for that date, based on the repeat number, which is the key field in the data. While that does sound much cleaner (I was waiting for you to swoop with a simple solution to save the day), wouldn't this solution give you 1 page per day as your output? I may have misunderstood the original post but I made the assumption that the output should be in this format. And (believe me) I know all too well what "they" say about assumptions which is why I asked for a sample. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 8, 2013 Share Posted August 8, 2013 I may have misunderstood the original post but I made the assumption that the output should be in this format. Oh, well, I thought that's what he meant by "a specific page," that it would be like a per-day tear-off calender. But if you want to output a month view as a grid, that's even easier. It's just a table, like in the Frodo Travel tutorial. You only need one page in your job, repeated 12 times, with a text frame calling out a rule to make the table. And (believe me) I know all too well what "they" say about assumptions which is why I asked for a sample. Yes, a picture is worth a thousand words (or, as we programmers say, 2K). Quote Link to comment Share on other sites More sharing options...
DDITC Posted August 9, 2013 Author Share Posted August 9, 2013 Thanks to both of you. Step, your method is working perfectly. Yet, it causes a great load of work. NB: is there anything like Paste & copy to generate the codes for all frames ? I hoped for a more automatized method that would add something like: <FindTextFrame(date[n]).PageNumber>= calculated page where PageNumber could be written instead of Read-only. Sorry for not sending the PDF file but I confirm the calender is more something like a per-day tear-off calender. In fact it's more like a 1/2 week tear-off calendar. I've looked at the Frodo tutorial, but it's limit is that I only print pages when a record points to them and print twice the same page if 2 records are within the same page. Moreover, I didn't add this data earlier but all pages in the PDF are different. And dates included in datas have no logic. This is why my original request was how to place a specific variable text in a specific page. Thanks for your help, Best regards, 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.