Topic Options
#56804 - 02/28/19 02:21 PM Total Pages
RomieB Offline
OL Newbie

Registered: 02/25/19
Posts: 3
I'm having difficulty obtaining the total number of pages in my document. I have read some posts on this forum on the matter but the suggestions and things tried successfully for others I have not been able to have success with.

I have a meta data variable called TotalPages
ID = TotalPages
Level: Document
Value: =GetMeta('SelectedPageCount[0]', 1, 'Job.Group.Document')
Create Action = Replace

&rbTest := getmeta('TotalPages')

rbTest displays 1

I have also tried setting up my meta like this:

Value: =inttostr(&current.overflowcount + 1)

And then getting my result like this: =GetMeta('TotalPages[0]', 0, 'Job.Group.Document')

Nothing seems to be working. Any suggestions or assistance is greatly appreciate as I've been working on this now for days.

#56805 - 02/28/19 04:45 PM Re: Total Pages [Re: RomieB]
Benoit Potvin Offline
OL Expert

Registered: 01/02/08
Posts: 490
Loc: Montréal, Canada

The reason things may not work with your custom metadata field "TotalPages" might be because it is a metadata field whose value is set based on metadata and this kind of circular reference may cause undesired behavior.

In any case, the total number of pages in a document, a group or a job is already available in the metadata attributes:

Total number of pages in current document:
=GetMeta('SelectedPageCount[0]', 1, 'Job.Group.Document')

Total number of pages in current group:
=GetMeta('SelectedPageCount[0]', 1, 'Job.Group')

Total number of pages in current job:
=GetMeta('SelectedPageCount[0]', 1, 'Job')

Hope this helps,
Knowledge is capital

#56826 - 03/07/19 11:50 AM Re: Total Pages [Re: Benoit Potvin]
RomieB Offline
OL Newbie

Registered: 02/25/19
Posts: 3
Thank you for your input. I did eventually figure out a solution to my issue. What I ended up doing was I first created a meta file using a sample xml file I was developing around. Once that was completed, I added a variable in my workflow called TotalPages. I then added a Set Job Infos and Variables Properties object to my work flow. In Var/Info# I put %{TotalPages}. In the Value section, I used the Get Metadata Location tool and loaded up my .meta file. After doing that I selected the document level as the metadata level and under product information I saw the value Pages in Document. I selected that and the Data Selector tool generated the following: GetMeta(SelectedPageCount[0], 11, Job.Group[0].Document[0]). That did the trick!

I hope this can help others!
Thank you!!