[poppler] 4 commits - utils/pdftoppm.1 utils/pdftoppm.cc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Mar 19 22:52:33 UTC 2019
utils/pdftoppm.1 | 6 ++++++
utils/pdftoppm.cc | 10 ++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
New commits:
commit 25cfa2ef6302b8e28ee2e9df2e81575306651afe
Author: Yves-Gaël Chény <gitlab at r0b0t.fr>
Date: Tue Mar 19 15:53:54 2019 +0000
Update pdftoppm.1
diff --git a/utils/pdftoppm.1 b/utils/pdftoppm.1
index 98ec24b5..79d78f4b 100644
--- a/utils/pdftoppm.1
+++ b/utils/pdftoppm.1
@@ -135,9 +135,6 @@ Specify the user password for the PDF file.
.B \-q
Don't print any messages or errors.
.TP
-.B \-e
-Generates only the even numbered pages.
-.TP
.BI \-sep " char"
Specify single character separator between name and page number, default - .
.TP
commit 4a6fc39f0309b163418aa4dc6148b46a8da50d4c
Author: Yves-Gaël Chény <gitlab at r0b0t.fr>
Date: Thu Mar 14 14:38:01 2019 +0000
Update pdftoppm.1 - un-remove -q description
diff --git a/utils/pdftoppm.1 b/utils/pdftoppm.1
index c545a56a..98ec24b5 100644
--- a/utils/pdftoppm.1
+++ b/utils/pdftoppm.1
@@ -132,6 +132,9 @@ bypass all security restrictions.
.BI \-upw " password"
Specify the user password for the PDF file.
.TP
+.B \-q
+Don't print any messages or errors.
+.TP
.B \-e
Generates only the even numbered pages.
.TP
commit de3e24d79dd82585da17771c9b85ed1ab5bc0b80
Author: ygcheny <gitlab at r0b0t.fr>
Date: Tue Mar 12 08:38:40 2019 +0100
- change typo and description for sep and forcenum
- append new parameters into man page
diff --git a/utils/pdftoppm.1 b/utils/pdftoppm.1
index 75a4f473..c545a56a 100644
--- a/utils/pdftoppm.1
+++ b/utils/pdftoppm.1
@@ -132,8 +132,14 @@ bypass all security restrictions.
.BI \-upw " password"
Specify the user password for the PDF file.
.TP
-.B \-q
-Don't print any messages or errors.
+.B \-e
+Generates only the even numbered pages.
+.TP
+.BI \-sep " char"
+Specify single character separator between name and page number, default - .
+.TP
+.B \-forcenum
+Force page number even if there is only one page.
.TP
.B \-v
Print copyright and version information.
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index c3f74582..5a8e7656 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -87,7 +87,7 @@ static bool useCropBox = false;
static bool mono = false;
static bool gray = false;
static char sep[2] = "-";
-static bool forcenum = false;
+static bool forceNum = false;
static bool png = false;
static bool jpeg = false;
static bool jpegcmyk = false;
@@ -159,8 +159,8 @@ static const ArgDesc argDesc[] = {
{"-gray", argFlag, &gray, 0,
"generate a grayscale PGM file"},
{"-sep", argString, sep, sizeof(sep),
- "single character separor between name and page number, default - "},
- {"-forcenum", argFlag, &forcenum, 0,
+ "single character separator between name and page number, default - "},
+ {"-forcenum", argFlag, &forceNum, 0,
"force page number even if there is only one page "},
#ifdef ENABLE_LIBPNG
{"-png", argFlag, &png, 0,
@@ -591,7 +591,7 @@ int main(int argc, char *argv[]) {
}
if (ppmRoot != nullptr) {
const char *ext = png ? "png" : (jpeg || jpegcmyk) ? "jpg" : tiff ? "tif" : mono ? "pbm" : gray ? "pgm" : "ppm";
- if (singleFile && !forcenum ) {
+ if (singleFile && !forceNum ) {
ppmFile = new char[strlen(ppmRoot) + 1 + strlen(ext) + 1];
sprintf(ppmFile, "%s.%s", ppmRoot, ext);
} else {
commit 6f267519d0399c6b1059b72892a23ace159588dd
Author: ygcheny <gitlab at r0b0t.fr>
Date: Mon Mar 11 12:20:40 2019 +0100
add to parameters for command line tools pdftoppm
-sep : single character separor between name and page number, default -
-forcenum : force page number even if there is only one page
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 7d72c8d2..c3f74582 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -86,6 +86,8 @@ static int sz = 0;
static bool useCropBox = false;
static bool mono = false;
static bool gray = false;
+static char sep[2] = "-";
+static bool forcenum = false;
static bool png = false;
static bool jpeg = false;
static bool jpegcmyk = false;
@@ -156,6 +158,10 @@ static const ArgDesc argDesc[] = {
"generate a monochrome PBM file"},
{"-gray", argFlag, &gray, 0,
"generate a grayscale PGM file"},
+ {"-sep", argString, sep, sizeof(sep),
+ "single character separor between name and page number, default - "},
+ {"-forcenum", argFlag, &forcenum, 0,
+ "force page number even if there is only one page "},
#ifdef ENABLE_LIBPNG
{"-png", argFlag, &png, 0,
"generate a PNG file"},
@@ -585,12 +591,12 @@ int main(int argc, char *argv[]) {
}
if (ppmRoot != nullptr) {
const char *ext = png ? "png" : (jpeg || jpegcmyk) ? "jpg" : tiff ? "tif" : mono ? "pbm" : gray ? "pgm" : "ppm";
- if (singleFile) {
+ if (singleFile && !forcenum ) {
ppmFile = new char[strlen(ppmRoot) + 1 + strlen(ext) + 1];
sprintf(ppmFile, "%s.%s", ppmRoot, ext);
} else {
ppmFile = new char[strlen(ppmRoot) + 1 + pg_num_len + 1 + strlen(ext) + 1];
- sprintf(ppmFile, "%s-%0*d.%s", ppmRoot, pg_num_len, pg, ext);
+ sprintf(ppmFile, "%s%s%0*d.%s", ppmRoot, sep, pg_num_len, pg, ext);
}
} else {
ppmFile = nullptr;
More information about the poppler
mailing list