Page 1 of 3 1 2 3 >
Topic Options
#31424 - 07/22/09 09:33 AM Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
I'm trying to get the total page count of my documents by using Create Metadata, but it's getting a whole different value from the real number of pages.

My .ptk file has a Metadata Field in Document Level named PageCount with the value:
Code:
= inttostr(&current.datapage)
Also, a PressTalk with:
Code:
define(&page,integer, 0)
&page:=ExecScriptFile('C:\\PageCounter\\writefile.vbs',getmeta('PageCount'), 0)
This writefile.vbs script contains:
Code:
dim pgcnt
dim FSO
dim NewFile

pgcnt = Script.ParamString
set FSO = CreateObject("Scripting.FileSystemObject")
set NewFile = FSO.CreateTextFile("C:\\PageCounter\\pgcnt.txt")

NewFile.WriteLine(pgcnt)
NewFile.Close
And, finally, a RunScript on Watch with this code among the rest of the script:
Code:
set FSO = CreateObject("Scripting.FileSystemObject")
set OpenFile = FSO.OpenTextFile("C:\\PageCounter\\pgcnt.txt", 1)
pgcnt = OpenFile.ReadLine
Watch.SetJobInfo 9, pgcnt
OpenFile.Close
Does anyone knows the reason why the page count returned, for example, 515 for a 6 pages document? Where's my mistake?

Thanks

Top
#31425 - 07/22/09 10:15 AM Re: Wrong Page Count
Benoit Potvin Offline
OL Expert

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

While I cannot help you with your script, here is how to access the total page count in your PlanetPress Design document without any script:

The metadata already have a Page count attribute. Try the following in order to display the total page count on a Page of your PlanetPress Design document:

1. Generate metadata for your PlanetPress Design document. It's a button in the ribbon's Tools submenu.

2. Create a text object. Inside of it, right click and choose 'Select data'. The data selector window opens.

3. Choose the 'Metadata' tab, then select the 'SelectedPageCount' attribute. This metadata attribute should contain the total number of pages that would compose the job once processed by the PlanetPress Design document.

Considering the relative complexity of your post, I am not sure if what I propose is actually what you are searching for, but as far as you only want the total number of physical pages produced by a PlanetPress Design document on a given datafile, then the easiest way is to use the SelectedPageCount metadata attribute.

If you are using a User-Defined Emulation, then it might not work however.

Hope this helps!

Benoit
_________________________
Knowledge is capital
http://twitter.com/benoitpotvin

Top
#31426 - 07/22/09 10:18 AM Re: Wrong Page Count
Benoit Potvin Offline
OL Expert

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

Quote:
Does anyone knows the reason why the page count returned, for example, 515 for a 6 pages document? Where's my mistake?
hum...

Could it be a data type conversion related problem? I.e. '5'+'1'= '51' VS 5+1=6

ben
_________________________
Knowledge is capital
http://twitter.com/benoitpotvin

Top
#31427 - 07/22/09 11:01 AM Re: Wrong Page Count
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1931
Loc: Objectif Lune, Montreal, Qc
Carlos,

After looking at your code, it looks like all you're trying to do is to store in PPWorkflow's Jobinfo 9 the number of pages in that job.

This requires only 2 simple steps:
1. Create Metadata
2. Set JobInfo and Variables, select %9 and then use Benoit's method described above to retrieve the value for the SelectedPageCount from the metadata.

As for why your script returns the wrong value, there could be a number of reasons. The most obvious one is that you store the number of Data Pages in your variable, instead of the number of Physical pages. Also, since you don't specify at which point you actually set the value for the metadata field, we don't know how many times it gets set.

But debugging all of this could be time-consuming, so I definitely recommend you use the metadata's native ways of accessing the page count.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#31428 - 07/22/09 01:28 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Thanks a lot for the help, but I found a problem trying to do it:

I generated the Metadata, created the Text object, and inside of it, on the Select Data/Metadata tab, there is no SelectedPageCount to select.
Any clues?
I'm still sniffing around on Design to find it, but any help would be valuable time! =]
Thanks a lot

Top
#31429 - 07/22/09 01:57 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Just to make the intention clear:
What we are looking for here is to get the number of pages in everything that is printed, in order to make... 'page separators'? I don't know what would be the correct term, please correct me if I'm wrong (would also help me on research).

Its that page in front of each printed job, with the user name, department, date/hour and the user data so it can be delivered for him in his desk.
(cover page? front page? page separator?
Its all perfect, already working with the Active Directory but we can't seem to get the number of pages printed on that job.

Top
#31430 - 07/23/09 12:54 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Is there any other way to do it?
Like get the number of pages out of the .SHD file in the spool folder?
If so, how do I get it? I couldnt find any documentation regarding this issue, and I'm looking for it for like a week, and no luck at all.

Thanks in advance!

Top
#31431 - 07/23/09 01:07 PM Re: Wrong Page Count
Benoit Potvin Offline
OL Expert

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

On your second post you say:
Quote:
I generated the Metadata, created the Text object, and inside of it, on the Select Data/Metadata tab, there is no SelectedPageCount to select.
I do not understand... The SelectedPageCount attribute is part of the metadata.

May I ask what metadata attributes you see when you use the data selector inside the text object? There should be dozens of attributes available to select, including:

- Count
- Creator
- DataEncoding
- Datafile
- DatapageCount
- Date
- Dimensions
- DocumentCount
- Duplex
...
- SelectedCount
- SelectedDatapageCount
- SelectedDocumentCount
...
- SelectedIndexInJob
- SelectedPageCount
- Side
...

Benoit
_________________________
Knowledge is capital
http://twitter.com/benoitpotvin

Top
#31432 - 07/23/09 01:10 PM Re: Wrong Page Count
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Quote:
Originally posted by carlos kochhann:
Is there any other way to do it?
Like get the number of pages out of the .SHD file in the spool folder?
If so, how do I get it? I couldnt find any documentation regarding this issue, and I'm looking for it for like a week, and no luck at all.

Thanks in advance!
Carlos,

I may have something I could show you that I think is pretty much what you want. It will be simpler, however, if you open a support issue, as it will be easier to explain the process on the phone.

Go to our web page, then Services->Support->Report an Issue, and give your contact information so that we can call you back. I recommend you provide a link to this thread, in case the tech assigned to the case isn't me.

Regards,
Rapha

Top
#31433 - 07/23/09 01:40 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Benoit,
Thanks a lot!
Is this the screen you meant?
I can't find any other that would suit the description.
If its this, then is something there missing?

Sorry for the trouble, I'm kinda new to this.

edit: lacking the image.


Raphael, I'll see here in the company about this service. They asked if its a free call or how it works. As I'm not in charge of anything here, I can't decide this.

Top
#31434 - 07/23/09 02:44 PM Re: Wrong Page Count
Benoit Potvin Offline
OL Expert

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

Have you tried refreshing the metadata? In your PlanetPress Design document, right-click over the 'Metadata Fields' folder in the document structure and choose Refresh Metadata.

If it doesn't work, I believe you should open a support ticket so Raphael or another support technician will be able to help you with your form.

If you are an OL Learn student, you can also ask for a live webinar on this this topic with a technical trainer, at a time that suits you best.

Hope this helps!

Ben
_________________________
Knowledge is capital
http://twitter.com/benoitpotvin

Top
#31435 - 07/24/09 08:49 AM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Edit:
Yay!
I talked to my boss here and he will give me our Serial, so I'll open the Support Issue to get this done! =]

But please, someone tell me how its called in English this printed'front page' with the user's information that is printed in big companies? I was told it was a 'separator page', but I never heard this term before.

Thanks,
Alexandre Taitson Moreira

edit2: Signed as Alexandre because me and Carlos are on this task with PP, and we made this account to post this.

Top
#31436 - 07/27/09 09:30 AM Re: Wrong Page Count
Raphael Lalonde Lefebvre Offline
OL Expert

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

Top
#31437 - 07/27/09 10:44 AM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Raphael,
Thanks a lot for the post! ^^
We tried that approach too, but we got an error message:

W3644: Error converting to PDF: Error converting file: Undefined
Digital Imaging: w1603: Plugin failed - xx:xx:xx (the time it failed)

We were trying to do in other way, because of the error.

And we can't seem to fix this =/

But again, thanks a BIG lot for the help, and for your time!
Can you help me with this error I got on Digital Imaging?

Top
#31438 - 07/27/09 11:39 AM Re: Wrong Page Count
Raphael Lalonde Lefebvre Offline
OL Expert

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

The Digital Imaging is expecting a postscript job, so this process will only work with a job that is printed through a postscript driver. Make sure you are using a postscript printer with a postscript driver. This will not work with PCL drivers.

Regards,
Rapha

Top
#31439 - 07/27/09 12:03 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
I checked it now, both printer and driver are postscript.

Any idea why this is still happening? =/

Thanks again

Top
#31440 - 07/27/09 12:50 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
I just tried changing the PS driver, and it still gave the same error.
The printer is for sure a PS printer, and the 2 drivers I tried are also PS.
Is there any obscure reason that could make this?
Should I paste here the process? You might see a mistake where I don't.

Top
#31441 - 07/27/09 01:15 PM Re: Wrong Page Count
Raphael Lalonde Lefebvre Offline
OL Expert

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

I had the information that when you capture using the PlanetPress Driver, it automatically creates metadata with the total page count.

So a much simpler solution would be to make a Winqueue Input using the PlanetPress driver, followed by a simple vbscript like this one:

Code:
dim oMeta
dim MetaJob

Set oMeta = CreateObject("MetadataLib.MetaFile")
oMeta.LoadFromFile(Watch.GetMetaDataFileName)
Set MetaJob = oMeta.Job()

Watch.SetJobInfo 9, MetaJob.Group(0).PageCount
This will get the page count in job info 9, and is much simpler(and safer) than the above method I posted(it was originally made for version 6 when we didn't have the nice tools of version 7). Then you can make the Create File and the output to a folder as I suggested.

If you do not have the PlanetPress Driver, double-click on your WinQueue Input, and click on "New". Enter any names you want, and that's it! You now have a new PlanetPress queue!

Regards,
Rapha

Top
#31442 - 07/27/09 01:39 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Hmm now we got an error here on that script:

w3602: Error 0 on line 69, column 1: MetadataLib.MetaFile: Error loading metadata file: File not found.

What would that be?
Would it be because in the script, the line:
oMeta.LoadFromFile(Watch.GetMetaDataFileName)
Is trying to get a filename from a file that wasn't created yet?
I mean, so far in the script it wasn't created, was it?

I googled it for no good as well.


edit:

Should I use a Create Metadata before the script runs?

Top
#31443 - 07/27/09 01:44 PM Re: Wrong Page Count
Raphael Lalonde Lefebvre Offline
OL Expert

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

In the WinQueue Input properties, make sure you check "Spool Print Jobs in RAW format", and also "Create PDF(with Metadata)". The error is caused because it can't find the metadata file, so there must be something wrong on the WinQueue Input level.

If it still cause errors, then please go ahead with opening the support issue, and we will be able to connect to your machine and figure out why it won't capture.

Regards,
Rapha

Top
#31444 - 07/27/09 01:52 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
We already tried with Raw format, with the "Composed Document Stream with metadata" option up. I really can't figure why this is happening. We are trying now with the Create Metadata before the script.


And what should I do about the Serial problem?
It keeps saying the serial is still not active, but it is.

Top
#31445 - 07/27/09 01:56 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
With the Create Metadata before the script, it said the object didn't support Group on that last line:

Watch.SetJobInfo 9, MetaJob.Group(0).PageCount

Top
#31446 - 07/27/09 02:54 PM Re: Wrong Page Count
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
If you're having problems using the web form for support issues, then call 1-866-348-5863, and request technical support.

Top
#31447 - 07/27/09 03:06 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Oooh damn, that might give me some trouble...
I don't think we can call Montreal x.x" (due to permissions)
I'll see what else I can do here >.<"

But big thanks for the help, Raphael! =]
Really big thanks!

Top
#31448 - 07/28/09 02:51 PM Re: Wrong Page Count
carlos kochhann Offline
Junior Member

Registered: 07/21/09
Posts: 15
Raphael (or anyone), we managed to capture the number of pages here, using a process and scripts based on yours, but with a little change, but for some unknown reason, the file won't print.

If we Stop the process, it prints normally, but with no Page count nor anything else, but if we Start it again, it won't print.
The problem must be something within the process, but I can't find out what.

Top
#31449 - 08/12/09 02:51 PM Re: Wrong Page Count
Benoit Potvin Offline
OL Expert

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

On july 27, you said:
Quote:
And what should I do about the Serial problem?
It keeps saying the serial is still not active, but it is.
If this problem is still present, may I ask the following questions:

1. Which module of the software suite is saying that the serial is not active? The Design tool? The Workflow tool? Both?

2. How does it keep saying it? Is it when you perform a specific action?

3. How do you know that it (i.e. the software) is in fact activated?

4. Does your machine match the system requirements as stated on on page 1 of the v7 release notes (found here )

Hope this helps!

Benoit
_________________________
Knowledge is capital
http://twitter.com/benoitpotvin

Top
Page 1 of 3 1 2 3 >