Getting PDF page count in workflow

I’ve got a job coming up where I need to process approx 1 million PDF’s an index file. I need to put the PDF’s into ZIPs in 2k chunks along with a new index file. One of the index fields needed is PDF page count. Is there an easier way of getting the page count of a PDF rather than put it into a mapper?

I obviously won’t be trying to run all 1million at once and will be running them in smaller chunks but I can imagine if I load the PDF’s into mapper it’s going to take days to process

A script task will do the trick:

var myPDF = Watch.GetPDFEditObject();
myPDF.Open(Watch.GetJobFileName(),false);

Watch.SetJobInfo(9,myPDF.Pages().Count());

myPDF.Close();

After the script has completed, JobInfo 9 contains the number of pages in the PDF

1 Like

Thanks Phil that’s perfect