IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#20803 - 10/18/07 09:56 AM print page cont when file is done printing
RobertE Offline
Member

Registered: 06/14/07
Posts: 32
I have an xml data file which builds 1000s of documents. The customer wants a seperate page for billing purposes which shows the number of pages the printer just printed for the job. This should be the last page off the printer when the job completes printing.

I have tried using talk code to increment a page count and show a count page when &eojob = true. This does not seem to work correctly with the xml file. My thinking is &eojob works for the line printer world, but not with XML.

As we are using the second element in XML emulation, we can not use xmlCount properly to tell us when we are on the last element and print the page. Because we do not see the entire document but the element we are currently on.

My next thought is to use some Watch programming to figure out the number of data elements in the xml and when the last one is reached in Planet Press, show the page count page.

My question is, before I go off and do this, is there a simple way in Planet Press or Watch (possibly a finishing option) where I can get a page count for the job by asking Planet Press/Watch for a generic status page for the job at the end of the job?

Thanks for your help,

Robert

Top
#20804 - 10/23/07 09:59 AM Re: print page cont when file is done printing
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
In Watch, there is no such options to print a status page which counts the number of pages printed. The XmlCount command also doesn't work in Watch, so the only way I see to do this is to use a vbscript to count the records, store the results in a job info, and then use this job info value in your form.

If you want to go this route, there are two useful tips I can give you:

The command to extract the name of the input file is:
Watch.GetJobFilename

And to set job infos within a vbscript:
Watch.SetJobInfo number,value

number is the job info's number(1 to 9), and value is whatever value you want to place in the job info. So to set job info 9 to 5000, you would type:

Watch.SetJobInfo 9, 5000


Hope this helps.

Regards,
Rapha

Top
#20805 - 10/23/07 01:28 PM Re: print page cont when file is done printing
Anonymous
Unregistered


Hello,

If 1 data page can produce more then 1 data page (or no data pages for that matter) then your script will have to take all of that into consideration. Basically, you will have to emulate your data the same as it is done in PlanetPress. This can be quite tedious and difficult. If your data page always produces 1 data page then this becomes easier.

Another possibility is you create a PDF copy of the print run (you will need PlanetPress Image). Once the PDF is created, you can have another PlanetPress Watch process pick up the PDF and using the PDF object available in VBScript you can open the PDF and check how many pages are in it. (Technically speaking you could even do this in a PlanetPress document). From there you could use that script to create a small data file (maybe include the customer numbers, the number of pages, etc) and then send that little data file to another PlanetPress document and print out the report you need.

Top
#20806 - 10/23/07 01:58 PM Re: print page cont when file is done printing
-nth- Offline
OL Expert

Registered: 04/01/03
Posts: 236
Loc: Lincoln, NE
Along Danny's thought track, here's some simple Presstalk code I've used to report the number of pages in a PDF:
Code:
&PDFFile := 'F:\\pdf2zip\\job1.pdf'
showright(inttostr(PDFPageCount(&PDFFile)))  
The PDF file name could be read from data, as well, instead of being static.

Hope this helps,

-nth-

Top
#20807 - 10/26/07 07:56 AM Re: print page cont when file is done printing
RobertE Offline
Member

Registered: 06/14/07
Posts: 32
Thank you all for your help. In the end, I have put everything into the Planet Press document. The document gets information from Watch Job Info variables. The last page printed is a "status" page with the job date, pages, and job name on it.

Robert

Top


Moderator:  cosimo, OL Newsgroup Support