Filter through even or odd number of pages
Filter through even or odd number of pages
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?
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
Filter through even or odd number of pages
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
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
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
Filter through even or odd number of pages
Small but important typo in my post. "% 1" should be "% 2".
job.getVariableAsNumber("[Stats.NumberOfPages]") % 2;
job.getVariableAsNumber("[Stats.NumberOfPages]") % 2;