[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-poppler
Subject: [poppler] utils/pdftocairo.cc
From: ajohnson () kemper ! freedesktop ! org (Adrian Johnson)
Date: 2016-01-11 11:32:10
Message-ID: 20160111113211.22FFA762E0 () kemper ! freedesktop ! org
[Download RAW message or body]
utils/pdftocairo.cc | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 3bfc45bfcca1a52447cedbb95afad1ef362ac6f0
Author: Adrian Johnson <ajohnson@redneon.com>
Date: Mon Jan 11 21:46:49 2016 +1030
pdftocairo: check for invalid use of -scale-to* and -paper[wh] options
Bug 92195
diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index a7257b4..b795b7b 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -835,8 +835,10 @@ int main(int argc, char *argv[]) {
int num_outputs;
// parse args
- if (!parseArgs(argDesc, &argc, argv))
+ if (!parseArgs(argDesc, &argc, argv)) {
+ printUsage("pdftocairo", 0, argDesc);
exit(99);
+ }
if ( resolution != 0.0 &&
(x_resolution == 150.0 ||
@@ -886,6 +888,9 @@ int main(int argc, char *argv[]) {
checkInvalidPrintOption(icc.getCString()[0], "-icc");
checkInvalidPrintOption(singleFile, "-singlefile");
checkInvalidPrintOption(useCropBox, "-cropbox");
+ checkInvalidPrintOption(scaleTo != 0, "-scale-to");
+ checkInvalidPrintOption(x_scaleTo != 0, "-scale-to-x");
+ checkInvalidPrintOption(y_scaleTo != 0, "-scale-to-y");
} else {
checkInvalidImageOption(level2, "-level2");
checkInvalidImageOption(level3, "-level3");
@@ -940,6 +945,11 @@ int main(int argc, char *argv[]) {
exit(99);
}
+ if ((paperWidth > 0 && paperHeight <= 0) || (paperWidth <= 0 && paperHeight > 0)) {
+ fprintf(stderr, "Error: both -paperw and -paperh must be specified.\n");
+ exit(99);
+ }
+
if (paperSize[0]) {
if (origPageSizes) {
fprintf(stderr, "Error: -origpagesizes and -paper may not be used together.\n");
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic