Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/pdfimages.cc
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1999-08-06 00:14:27 (GMT)
committer Arturo Espinosa <unammx@src.gnome.org>1999-08-06 00:14:27 (GMT)
commit50e9d31c05e9ca11ad43cc570556094782c1b956 (patch)
treee8d30241d1f97d7a52ad4486089a74e55160ad78 /pdf/xpdf/pdfimages.cc
parentbd7dce23fec36adeb1713c164d594bbc0436b346 (diff)
Painful merge.
Painful merge. I merged the latest release into the CVS. This version supports the regular xpdf or gpdf if the GNOME libraries are found. Miguel.
Diffstat (limited to 'pdf/xpdf/pdfimages.cc')
-rw-r--r--pdf/xpdf/pdfimages.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/pdf/xpdf/pdfimages.cc b/pdf/xpdf/pdfimages.cc
index 1825a26..1dd59f0 100644
--- a/pdf/xpdf/pdfimages.cc
+++ b/pdf/xpdf/pdfimages.cc
@@ -39,6 +39,8 @@ static ArgDesc argDesc[] = {
"last page to convert"},
{"-j", argFlag, &dumpJPEG, 0,
"write JPEG images as JPEG files"},
+ {"-q", argFlag, &errQuiet, 0,
+ "don't print any messages or errors"},
{"-h", argFlag, &printHelp, 0,
"print usage information"},
{"-help", argFlag, &printHelp, 0,
@@ -70,11 +72,18 @@ int main(int argc, char *argv[]) {
// read config file
initParams(xpdfConfigFile);
- // open PDF file
+ // open PDF fihe
xref = NULL;
doc = new PDFDoc(fileName);
- if (!doc->isOk())
- exit(1);
+ if (!doc->isOk()) {
+ goto err1;
+ }
+
+ // check for copy permission
+ if (!doc->okToCopy()) {
+ error(-1, "Copying of images from this document is not allowed.");
+ goto err2;
+ }
// get page range
if (firstPage < 1)
@@ -89,12 +98,14 @@ int main(int argc, char *argv[]) {
delete imgOut;
// clean up
+ err2:
delete doc;
+ err1:
freeParams();
// check for memory leaks
- Object::memCheck(errFile);
- gMemReport(errFile);
+ Object::memCheck(stderr);
+ gMemReport(stderr);
return 0;
}