summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorThomas Freitag <Thomas.Freitag@kabelmail.de>2011-09-18 18:19:04 +0200
committerAlbert Astals Cid <aacid@kde.org>2011-09-18 18:19:04 +0200
commit90da1af542fd7f3cecef31b15da6971345b38209 (patch)
tree53152352fdd84e46b432a3ccd64a54c2796c0089 /utils
parent40e066a84ddb3a5c41805c095659af5f5704d6d8 (diff)
Complain if %d is not present and it should
Diffstat (limited to 'utils')
-rw-r--r--utils/pdfextract.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/pdfextract.cc b/utils/pdfextract.cc
index c8c47496..d6a7eb5c 100644
--- a/utils/pdfextract.cc
+++ b/utils/pdfextract.cc
@@ -63,6 +63,10 @@ bool extractPages (const char *srcFileName, const char *destFileName) {
lastPage = doc->getNumPages();
if (firstPage == 0)
firstPage = 1;
+ if (firstPage != lastPage && strstr(destFileName, "%d") == NULL) {
+ error(-1, "'%s' must contain '%%d' if more than one page should be extracted", destFileName);
+ return false;
+ }
for (int pageNo = firstPage; pageNo <= lastPage; pageNo++) {
sprintf (pathName, destFileName, pageNo);
GooString *gpageName = new GooString (pathName);