summaryrefslogtreecommitdiff
path: root/utils/pdftops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'utils/pdftops.cc')
-rw-r--r--utils/pdftops.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/utils/pdftops.cc b/utils/pdftops.cc
index b54fd425..e003baac 100644
--- a/utils/pdftops.cc
+++ b/utils/pdftops.cc
@@ -81,7 +81,7 @@ static GBool level2 = gFalse;
static GBool level2Sep = gFalse;
static GBool level3 = gFalse;
static GBool level3Sep = gFalse;
-static GBool doOrigPageSizes = gFalse;
+static GBool origPageSizes = gFalse;
static GBool doEPS = gFalse;
static GBool doForm = gFalse;
#if OPI_SUPPORT
@@ -129,7 +129,7 @@ static const ArgDesc argDesc[] = {
"generate Level 3 PostScript"},
{"-level3sep", argFlag, &level3Sep, 0,
"generate Level 3 separable PostScript"},
- {"-origpagesizes",argFlag, &doOrigPageSizes,0,
+ {"-origpagesizes",argFlag, &origPageSizes,0,
"conserve original page sizes"},
{"-eps", argFlag, &doEPS, 0,
"generate Encapsulated PostScript (EPS)"},
@@ -231,10 +231,9 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "Error: use only one of the 'level' options.\n");
exit(1);
}
- if ((doOrigPageSizes ? 1 : 0) +
- (doEPS ? 1 : 0) +
+ if ((doEPS ? 1 : 0) +
(doForm ? 1 : 0) > 1) {
- fprintf(stderr, "Error: use only one of -origpagesizes, -eps, and -form\n");
+ fprintf(stderr, "Error: use only one of -eps, and -form\n");
exit(1);
}
if (level1) {
@@ -254,15 +253,21 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "Error: forms are only available with Level 2 output.\n");
exit(1);
}
- mode = doOrigPageSizes ? psModePSOrigPageSizes
- : doEPS ? psModeEPS
- : doForm ? psModeForm
- : psModePS;
+ mode = doEPS ? psModeEPS
+ : doForm ? psModeForm
+ : psModePS;
fileName = new GooString(argv[1]);
// read config file
globalParams = new GlobalParams();
+ if (origPageSizes) {
+ paperWidth = paperHeight = -1;
+ }
if (paperSize[0]) {
+ if (origPageSizes) {
+ fprintf(stderr, "Error: -origpagesizes and -paper may not be used together.\n");
+ exit(1);
+ }
if (!setPSPaperSize(paperSize, paperWidth, paperHeight)) {
fprintf(stderr, "Invalid paper size\n");
delete fileName;