Topic Options
#57223 - 09/16/19 05:30 AM number of pages variable
Blue_Nose Offline
OL Newbie

Registered: 09/01/10
Posts: 8
Hi,
I need to create a barcode with the number of pages as a suffix in the barcode. i.e. 1 of 3, 2 of 3 etc so the barcode would be[invoice number]+[page number]+[total pages] but the spool doesn't contain the total number of pages detail. Can I create a variable for this?

Thanks

Top
#57267 - 10/30/19 03:35 PM Re: number of pages variable [Re: Blue_Nose]
Jim Dornbos Offline
OL Expert

Registered: 07/23/08
Posts: 151
Loc: Flint, Michigan
I am not a metadata pro, but metadata is your answer. You tell PlanetPress how to group the spool into sets and metadata will have a variable containing the total number of pages in the set.

I use it rarely, so if you can't figure it out from the docs/online help, ask for more help here - and maybe somebody who knows what they're talking about can guide you further.


Edited by Jean-Cédric (10/30/19 03:38 PM)

Top
#57269 - 10/31/19 10:13 AM Re: number of pages variable [Re: Blue_Nose]
jim3108 Online   content
OL Expert

Registered: 04/19/10
Posts: 285
Loc: London, UK
Jim is right.
To get what you need, assuming a variable of InvoiceNumber defined as global in the document, I would do the following:

I'd probably build my barcode string into a variable in a PressTalk object just before the barcode object so that I have control over it and don't have to mess about in the small string field in the object properties.

Define a global variable (type: string) in the document structure called BarcodeString

PressTalk code
Code:
define(&PageNumber, string, inttostr(&current.printpage))
define(&TotalPages, string, GetMeta('SelectedPageCount[0]', 1, 'Job.Group.Document'))
&BarcodeString := inttostr(&InvoiceNumber) + &PageNumber + &TotalPages

Then in your barcode object, just set the barcode string to: &BarcodeString and this should do it.

NB: This presupposes that you have a simple document boundary setup and aren't using a user-defined emulation.

Hope this helps.

Best,

James.

Top
#57340 - 12/09/19 11:18 AM Re: number of pages variable [Re: Blue_Nose]
Stephenlnoe Offline
OL Newbie

Registered: 11/07/19
Posts: 19
How would I use this get "Page X of N" for printer centric mode? It does give me the page count but of course the getmeta will not work for printer centric. Right now the code looks like this:

define(&PageNumber, string, inttostr(&current.printpage))
define(&TotalPages, string, GetMeta('SelectedPageCount[0]', 1, 'Job.Group.Document'))
&PageTotals := 'Page' + &PageNumber+ 'of' + &TotalPages

What should change to get the total page count for printer centric?

Top
#57341 - 12/09/19 11:23 AM Re: number of pages variable [Re: Blue_Nose]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 497
Loc: Québec, Canada
The only way of doing this in Printer Centric mode is to preprocess your data in Workflow, add the page numbering to it and then generate the form.

Top
#57342 - 12/09/19 12:21 PM Re: number of pages variable [Re: Blue_Nose]
Stephenlnoe Offline
OL Newbie

Registered: 11/07/19
Posts: 19
Seems like I should be able to use:

&current.lastoverflowrepetition in relationship to &iterationcount defined in the line repeat to net the whole number?

for instance:
&current.lastoverflowrepetition = 8
&iterationcount = 5

Maybe if &current.lastoverflowrepetition greater than 5 but less than 10 = 2?
if &current.lastoverflowrepetition greater than 10 but less than 15 =3?

How could that be written to take advantage of 2 knowns?

Top
#57343 - 12/09/19 12:38 PM Re: number of pages variable [Re: Blue_Nose]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 497
Loc: Québec, Canada
Can't help you more without seeing the data and the form you have created.

I suggest you open a technical support request on our website, so a technician can review your form and data.

Top
#57351 - 12/16/19 05:03 PM Re: number of pages variable [Re: Blue_Nose]
Stephenlnoe Offline
OL Newbie

Registered: 11/07/19
Posts: 19
figured it out with a little help:

define(&PageNumber, string, inttostr(&current.printpage))
&PageTotals := 'Page ' + &PageNumber
&LastPage:= inttostr(ceil(inttofloat(xmlcount('/Document[1]/Page[1]/SalesOrderLines[1]/SalesOrderLine'))/5))

Top