Page 1 of 1

Filter through even or odd number of pages

Posted: Thu Jun 02, 2011 11:30 pm
by CGXTex
I know you can filter a pdf based on a specific number of pages, but how do you filter based on even or odd number of pages?

Filter through even or odd number of pages

Posted: Fri Jun 03, 2011 4:46 pm
by dkelly
Hello, you could calculate the modulo of the page count in Javascript expression.



I used a "Sort Job" element with the following JavaScript expression. The output connections need to be named "0" for even page counts and "1" for odd.



job.getVariableAsNumber("[Stats.NumberOfPages]") % 1;





Dwight Kelly

Apago, Inc.

dkelly@apago.com

Filter through even or odd number of pages

Posted: Tue Jun 07, 2011 5:51 pm
by dkelly
Small but important typo in my post. "% 1" should be "% 2".



job.getVariableAsNumber("[Stats.NumberOfPages]") % 2;