cancel
Showing results for 
Search instead for 
Did you mean: 
T_Winkler
Member
Member

How to use external process for comparing PDF page amounts?

We want to compare the page number of our MAX field entry (pages ordered by the customer) with the amount of pages in the printfile. If the amount is the same it should pass, if it differs, the job should stop, sending a message or whatever.
The external process seems to be fine for this, but how could we get on the amount of pages in the printfile and send it in different process steps?

0 Kudos
12 Replies
RRD_Jeff
Frequent Member
Frequent Member

Re: How to use external process for comparing PDF page amounts?

This is somthing I would like Xeox to handel with Route, there should be a Route

where I can say if $FPages$ = $FFwfDoc.pages$ then (Proceed to printer)

All else get saved in a Failed folder.

 

$FPages$ = a MAX Variable in the CSV.

What this would be used for is if my customer put 2 Pages in the file name but the fial actualy has only 1 Page it would fail and not go to the printer.

0 Kudos
T_Winkler
Member
Member

Re: How to use external process for comparing PDF page amounts?

I agree with you, that would be elegant. But in version 6.1.3 I can only compare to a fixed number.

0 Kudos
StefanT-Xerox
FreeFlow User

Re: How to use external process for comparing PDF page amounts?

Here is an idea.

Assume your manifest looks like this:

C:\Temp\file.pdf;5

where the first column is the pdf and the second is the number of pages ordered. Assuming the second column is given the custom field name jobpages you can in an External Process use the parameters:

"$FFin$" "$FFout$" "$FFwfDoc.pages$" "$FFjobpages$"

and use the attached batch file that runs the attached Python script:

import sys

pages1 = sys.argv[3]
pages2 = sys.argv[4]

if pages1 == pages2:
     print ('Good')
else:
     sys.exit(1)

If the number of pages in the file equal the number of pages ordered then the job keeps going in the workflow or else the script exits and the job fails.

Stefan

0 Kudos
RRD_Jeff
Frequent Member
Frequent Member

Re: How to use external process for comparing PDF page amounts?

Althoug that may work I then Loose all the benifits of using Max IE sending information to the printer with Stock, Copy Count, Ect. For MAX it all has to work in 1 pass no external processes. Otherwise i would just rename the file and dropp it in a hot folder to send it to the printer.

0 Kudos
T_Winkler
Member
Member

Re: How to use external process for comparing PDF page amounts?

Hello Stefan,

this looks good to work. But FreeFlow has a problem with reading the variable "$FFAnzahlSeitenPDF$"

[FreeFlowCore] Beim FreeFlow Core-Auftrag 28279 ist der folgende Fehler aufgetreten: Bei der Auswertung des Ausdrucks "AnzahlSeitenPDF" ist ein Fehler aufgetreten.-

This is the entry of the external node:

"$FFin$" "$FFout$" "$FFwfDoc.pages$" "$FFAnzahlSeitenPDF$"

 

By the way, is there a possibility for me sending up screenshots or ZIP files?

0 Kudos
StefanT-Xerox
FreeFlow User

Re: How to use external process for comparing PDF page amounts?

Here is how I set it up.

Manifest:

C:\Temp\file.pdf;8

In the MAX Setup column A is the file name and column B is the custom field jobpages.

jobpages.PNG

External Process setup:

ext.PNG

You need to point to the batch file in the External Process. In the batch file you may also need to change the path to Python and to the FreeFlow Core scripts folder where both the batch file and the Python script should be placed.

If jobpages equals the number of pages in the pdf, then the job completes and if not, it fails.

job manager.PNG

I don't think you can upload attachments but you could use something like wetransfer.com och paste the link.

I am using FreeFlow Core version 6.1.4.

Stefan

 

 

 

0 Kudos
T_Winkler
Member
Member

Re: How to use external process for comparing PDF page amounts?

Hello Stefan,

it was completely my mistake. I did not installed Python on the server. Our other external programs are working with batch script language. After installing it, everything works fine. Many thanks for your help. So the subject is solved.


The error message send from the system is like this:

[FreeFlowCore] Beim FreeFlow Core-Auftrag 28365 ist der folgende Fehler aufgetreten: Auftrag 5 hat Status "Abgebrochen"

Why is the number of the job 5? Do we have two different internal Job numbers?

0 Kudos
StefanT-Xerox
FreeFlow User

Re: How to use external process for comparing PDF page amounts?

Glad to hear you got it working.

I see the issue with the email notification giving two job numbers. Please contact your local Xerox support to have the issue resolved.

Stefan

0 Kudos
T_Winkler
Member
Member

Re: How to use external process for comparing PDF page amounts?

In addition for a good comparision I need to use a further variable in the external script. This variable is a string. But all tries to compare a string value failed so far.
Is this a reglementation within the external script function in combination with python?
Or do you have any kind of example with handling of a string variable?

 

0 Kudos