Topic Options
#41752 - 12/18/12 10:21 AM Count printed pages
Alessandro Rossi Offline
OL Newbie

Registered: 11/15/10
Posts: 11
Hi,
I'm developing a process on PlanetPress Workflow 7.4.0, and I have the following trouble:

My process has a printer queue output. Before the end of the process I need to know how many pages will be printed (inside a script), because with the same process I can print different documents (.ptk) of different lengths (physical pages).

Thank you in advance
Alessandro Rossi

Top
#41755 - 12/18/12 11:21 AM Re: Count printed pages [Re: Alessandro Rossi]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Alessandro,

You could use "Create Metadata", which will preprocess the job and produce metadata that will contain all sort of information, such as how many pages were produced. And like a printer queue output, it can use a dynamic name for the .ptk file.

You can then step through this in Debug, which will give you a sample metadata file to work with, and use it's values wherever you need to.

Regards,
Raphaël Lalonde Lefebvre

Top
#41764 - 12/19/12 03:56 AM Re: Count printed pages [Re: Raphael Lalonde Lefebvre]
Alessandro Rossi Offline
OL Newbie

Registered: 11/15/10
Posts: 11
Hi,
I tried it, adding the task "Create Metadata" and then using the following instruction:
GetMeta(PageCount[0], 11, Job)
but it says that the number of pages is 9 even if the PDF (or the print) generated has 24 pages...

Thank you
Alessandro Rossi.

Top
#41766 - 12/19/12 08:07 AM Re: Count printed pages [Re: Alessandro Rossi]
Alessandro Rossi Offline
OL Newbie

Registered: 11/15/10
Posts: 11
I would like to add that the PDF generated has the following PDI file, and pages seems to be 9, but counting the PDF pages, are 24, not 9!
Why?
Does anybody can help me?

~FormName=Document1
~ArchiveFile=9
~Time=12:27:41
~Date=2012/12/19
~ArchiveMethod=PDF
~DataEncoding=MS-CP-1252
~Page=0
~Page=2
~Page=4
~Page=12
~Page=13
~Page=14
~Page=16
~Page=20
~Page=22

Top
#41779 - 12/20/12 03:51 AM Re: Count printed pages [Re: Alessandro Rossi]
Alessandro Rossi Offline
OL Newbie

Registered: 11/15/10
Posts: 11
I've found where the problem is. (but I haven't solved all my troubles)
On my Document I attached after some pages, some ps files, and those are not counted as pages. Other pages counted (even if are not created) are pages with the flag "To Archive" unchecked. Even if I created a PDF file (so those pages are not created), with PageCount attribute, those pages are counted.

The trouble I remained is that on my Document I defined the data page with a user defined Talk script. When I try to debug from WorkFlow my process, even if I have more than one DataPage, "View Metadata" button shows me only one datapage with all pages of my data file (so in every level Process, Group, Document and DataPage I have the same PageCount number with the total pages of my file and not divided per DataPage, e.g. I have 100 and not 20 times 5, supposing my file contains 20 datapages of 5 pages each). It seem that Workflow can't recognize datapages condition, even if the final PDF creation works properly

The Talk code I use to divide Datapages is:

search(&str,'A001DATI ')
set(&current.line,&current.line + 1)
store(&current.line,&str)
doform()
clearpage()
endsearch()
set(&current.line,&current.line + 1)
store(&current.line,&str)
if(ge(&current.line,&current.lpp))
doform()
clearpage()
endif()


Thank you
Alessandro.

Top
#41780 - 12/20/12 09:05 AM Re: Count printed pages [Re: Alessandro Rossi]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Alessandro,

The problem may be that you are using a User-Defined Emulation. Unfortunately, Metadata is not supported with a User-Defined Emulation, and using the two together will produce unexpected behaviors, and wrong calculations, as is the case here.

I would suggest that you switch to a line printer emulation, and maybe add Form Feed characters to your data to split the data pages(you'll probably have to use Workflow to do this, the exact steps will depend on how your data is built...). With line printer emulation, the Metadata page count should be good.

Regards,
Raphaël Lalonde Lefebvre

Top