summaryrefslogtreecommitdiff
path: root/utils/pdftoppm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'utils/pdftoppm.cc')
-rw-r--r--utils/pdftoppm.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index aac1f743..b14312fe 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -517,6 +517,17 @@ int main(int argc, char *argv[]) {
goto err1;
}
+ // If our page range selection and document size indicate we're only
+ // outputting a single page, ensure that even/odd page selection doesn't
+ // filter out that single page.
+ if (firstPage == lastPage &&
+ ((printOnlyEven && firstPage % 2 == 0) ||
+ (printOnlyOdd && firstPage % 2 == 1))) {
+ fprintf(stderr, "Invalid even/odd page selection, no pages match criteria.\n");
+ goto err1;
+ }
+
+
if (singleFile && firstPage < lastPage) {
if (!quiet) {
fprintf(stderr,