Topic Options
#29669 - 10/02/07 08:32 PM total page function
jackping Offline
OL Newbie

Registered: 07/10/07
Posts: 17
Loc: Auckland
Is it possible to add a function called TotalPage which can show the total number of pages in a particular datapage in PP Design? So far when we can only calculate the total page base on some static page trigger or the number of transations shown per page. However my project has some dynamic images which made me unable to calculate the total page by any of the things above. I can never know the total page before I created the images.

Or, if the TotalPage function is impossible, you can create a function which can pass the job info from PP Design to PP Watch. At the moment the job info can only be passed from Watch to Design but not vise versa. If it is possible, I can use a splitter to seperate the data, run the Design document, pass the total page to Watch and then run the PP Design again and generate the document. I know that will slow down the process but better than none.

#29670 - 10/03/07 10:42 AM Re: total page function


The main issue with calculating the total number of pages as you mention here is the fact that the job will have to be run. There is no way to find out how many pages will be created if the job is not run. This would cause a very high demand on CPU power as everything would have to be crunched to calculate the number of pages.

Using PlanetPress Talk code and calling the objects yourself it may be possible to calculate this, however there are a few factors involved that could make it more or less impossible at design time. Also, it would really slow down the designer from having to cruch the pages multiple times.

When I come across cases like this I usually use the following method (requires PlanetPress Watch).

I send my document to PlanetPress Watch and I create a process that sends my data file to a printer queue that calls up my PlanetPress document. However, the printer queue is actually a send to folder (you select this when you create the queue). Make sure that optimized PostScript option is checked.

What this will net us is a consumed PostScript (page based) file. Now we can actually parse this file using scripting to determine how many pages belong to each customer. To make the parsing easier, you can add tags into the PostScript stream at the document level. For example, we would need to know when we are dealing with a new customer. So at the PressTalk before Page level you could add something like (passthrough('%%NEWCLIENT') and these in your script look for that tag.

Once you parse the file, you will need to merge the page information back into your original data file and then resend that data file.

Even with this method you have to run everything twice. We have used this method multiple times with great success here. Hopefully it makes at least a bit of sense.