pdfimages.cc (xpdf-4.03) | : | pdfimages.cc (xpdf-4.04) | ||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
#include "Error.h" | #include "Error.h" | |||
#include "config.h" | #include "config.h" | |||
static int firstPage = 1; | static int firstPage = 1; | |||
static int lastPage = 0; | static int lastPage = 0; | |||
static GBool dumpJPEG = gFalse; | static GBool dumpJPEG = gFalse; | |||
static GBool dumpRaw = gFalse; | static GBool dumpRaw = gFalse; | |||
static GBool list = gFalse; | static GBool list = gFalse; | |||
static char ownerPassword[33] = "\001"; | static char ownerPassword[33] = "\001"; | |||
static char userPassword[33] = "\001"; | static char userPassword[33] = "\001"; | |||
static GBool verbose = gFalse; | ||||
static GBool quiet = gFalse; | static GBool quiet = gFalse; | |||
static char cfgFileName[256] = ""; | static char cfgFileName[256] = ""; | |||
static GBool printVersion = gFalse; | static GBool printVersion = gFalse; | |||
static GBool printHelp = gFalse; | static GBool printHelp = gFalse; | |||
static ArgDesc argDesc[] = { | static ArgDesc argDesc[] = { | |||
{"-f", argInt, &firstPage, 0, | {"-f", argInt, &firstPage, 0, | |||
"first page to convert"}, | "first page to convert"}, | |||
{"-l", argInt, &lastPage, 0, | {"-l", argInt, &lastPage, 0, | |||
"last page to convert"}, | "last page to convert"}, | |||
{"-j", argFlag, &dumpJPEG, 0, | {"-j", argFlag, &dumpJPEG, 0, | |||
"write JPEG images as JPEG files"}, | "write JPEG images as JPEG files"}, | |||
{"-raw", argFlag, &dumpRaw, 0, | {"-raw", argFlag, &dumpRaw, 0, | |||
"write raw data in PDF-native formats"}, | "write raw data in PDF-native formats"}, | |||
{"-list", argFlag, &list, 0, | {"-list", argFlag, &list, 0, | |||
"write information to stdout for each image"}, | "write information to stdout for each image"}, | |||
{"-opw", argString, ownerPassword, sizeof(ownerPassword), | {"-opw", argString, ownerPassword, sizeof(ownerPassword), | |||
"owner password (for encrypted files)"}, | "owner password (for encrypted files)"}, | |||
{"-upw", argString, userPassword, sizeof(userPassword), | {"-upw", argString, userPassword, sizeof(userPassword), | |||
"user password (for encrypted files)"}, | "user password (for encrypted files)"}, | |||
{"-verbose", argFlag, &verbose, 0, | ||||
"print per-page status information"}, | ||||
{"-q", argFlag, &quiet, 0, | {"-q", argFlag, &quiet, 0, | |||
"don't print any messages or errors"}, | "don't print any messages or errors"}, | |||
{"-cfg", argString, cfgFileName, sizeof(cfgFileName), | {"-cfg", argString, cfgFileName, sizeof(cfgFileName), | |||
"configuration file to use in place of .xpdfrc"}, | "configuration file to use in place of .xpdfrc"}, | |||
{"-v", argFlag, &printVersion, 0, | {"-v", argFlag, &printVersion, 0, | |||
"print copyright and version info"}, | "print copyright and version info"}, | |||
{"-h", argFlag, &printHelp, 0, | {"-h", argFlag, &printHelp, 0, | |||
"print usage information"}, | "print usage information"}, | |||
{"-help", argFlag, &printHelp, 0, | {"-help", argFlag, &printHelp, 0, | |||
"print usage information"}, | "print usage information"}, | |||
skipping to change at line 101 | skipping to change at line 104 | |||
fprintf(stderr, "%s\n", xpdfCopyright); | fprintf(stderr, "%s\n", xpdfCopyright); | |||
if (!printVersion) { | if (!printVersion) { | |||
printUsage("pdfimages", "<PDF-file> <image-root>", argDesc); | printUsage("pdfimages", "<PDF-file> <image-root>", argDesc); | |||
} | } | |||
goto err0; | goto err0; | |||
} | } | |||
fileName = argv[1]; | fileName = argv[1]; | |||
imgRoot = argv[2]; | imgRoot = argv[2]; | |||
// read config file | // read config file | |||
if (cfgFileName[0] && !pathIsFile(cfgFileName)) { | ||||
error(errConfig, -1, "Config file '{0:s}' doesn't exist or isn't a file", | ||||
cfgFileName); | ||||
} | ||||
globalParams = new GlobalParams(cfgFileName); | globalParams = new GlobalParams(cfgFileName); | |||
if (verbose) { | ||||
globalParams->setPrintStatusInfo(verbose); | ||||
} | ||||
if (quiet) { | if (quiet) { | |||
globalParams->setErrQuiet(quiet); | globalParams->setErrQuiet(quiet); | |||
} | } | |||
// open PDF file | // open PDF file | |||
if (ownerPassword[0] != '\001') { | if (ownerPassword[0] != '\001') { | |||
ownerPW = new GString(ownerPassword); | ownerPW = new GString(ownerPassword); | |||
} else { | } else { | |||
ownerPW = NULL; | ownerPW = NULL; | |||
} | } | |||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 10 lines changed or added |