BL-705: Restrict the range of pages 'printed' to make PDF

Restrict the range of pages printed to the ones that actually exist,
which prevents Gecko adding an extra blank one.
Yes, it wasn't obvious what would be clearest. I wanted to make the algorithms for HidePages and CountPages as obviously related as I could. Another option would be to make HidePages return the page count...then you would have to call it for all three cases, of course. Or you could initialize hidePredicate to null and make Hide/Count do something appropriate with null, then call both outside the switch.