[poppler] poppler/utils: pdffonts.cc, 1.4, 1.5 pdfimages.cc, 1.2, 1.3 pdfinfo.cc, 1.4, 1.5 pdftohtml.cc, 1.4, 1.5 pdftoppm.cc, 1.3, 1.4 pdftops.cc, 1.4, 1.5 pdftotext.cc, 1.4, 1.5

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Feb 24 15:43:38 PST 2007


Update of /cvs/poppler/poppler/utils
In directory kemper:/tmp/cvs-serv20555/utils

Modified Files:
	pdffonts.cc pdfimages.cc pdfinfo.cc pdftohtml.cc pdftoppm.cc 
	pdftops.cc pdftotext.cc 
Log Message:
2007-02-25  Albert Astals Cid <aacid at kde.org>

        * configure.ac:
        * glib/poppler-document.cc:
        * poppler/GlobalParams.cc:
        * poppler/GlobalParams.h:
        * poppler/PSOutputDev.cc:
        * qt/poppler-document.cc:
        * qt4/src/poppler-document.cc:
        * qt4/src/poppler-private.h:
        * qt4/src/poppler-qt4.h:
        * test/gtk-splash-test.cc:
        * test/pdf-inspector.cc:
        * utils/pdffonts.cc:
        * utils/pdfimages.cc:
        * utils/pdfinfo.cc:
        * utils/pdftohtml.cc:
        * utils/pdftoppm.cc:
        * utils/pdftops.cc:
        * utils/pdftotext.cc: Remove dependency on xpdfrc file and cleanup
                              GlobalParams accordingly


Index: pdffonts.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdffonts.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pdffonts.cc	4 Aug 2006 22:48:09 -0000	1.4
+++ pdffonts.cc	24 Feb 2007 23:43:35 -0000	1.5
@@ -43,7 +43,6 @@
 static int lastPage = 0;
 static char ownerPassword[33] = "\001";
 static char userPassword[33] = "\001";
-static char cfgFileName[256] = "";
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
@@ -56,8 +55,6 @@
    "owner password (for encrypted files)"},
   {"-upw",    argString,   userPassword,   sizeof(userPassword),
    "user password (for encrypted files)"},
-  {"-cfg",        argString,      cfgFileName,    sizeof(cfgFileName),
-   "configuration file to use in place of .xpdfrc"},
   {"-v",      argFlag,     &printVersion,  0,
    "print copyright and version info"},
   {"-h",      argFlag,     &printHelp,     0,
@@ -102,7 +99,7 @@
   fileName = new GooString(argv[1]);
 
   // read config file
-  globalParams = new GlobalParams(cfgFileName);
+  globalParams = new GlobalParams();
 
   // open PDF file
   if (ownerPassword[0] != '\001') {

Index: pdfimages.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdfimages.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pdfimages.cc	23 Jan 2006 15:40:54 -0000	1.2
+++ pdfimages.cc	24 Feb 2007 23:43:35 -0000	1.3
@@ -35,7 +35,6 @@
 static char ownerPassword[33] = "\001";
 static char userPassword[33] = "\001";
 static GBool quiet = gFalse;
-static char cfgFileName[256] = "";
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
@@ -52,8 +51,6 @@
    "user password (for encrypted files)"},
   {"-q",      argFlag,     &quiet,         0,
    "don't print any messages or errors"},
-  {"-cfg",        argString,      cfgFileName,    sizeof(cfgFileName),
-   "configuration file to use in place of .xpdfrc"},
   {"-v",      argFlag,     &printVersion,  0,
    "print copyright and version info"},
   {"-h",      argFlag,     &printHelp,     0,
@@ -92,7 +89,7 @@
   imgRoot = argv[2];
 
   // read config file
-  globalParams = new GlobalParams(cfgFileName);
+  globalParams = new GlobalParams();
   if (quiet) {
     globalParams->setErrQuiet(quiet);
   }

Index: pdfinfo.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdfinfo.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pdfinfo.cc	4 Aug 2006 22:48:09 -0000	1.4
+++ pdfinfo.cc	24 Feb 2007 23:43:35 -0000	1.5
@@ -43,7 +43,6 @@
 static char textEncName[128] = "";
 static char ownerPassword[33] = "\001";
 static char userPassword[33] = "\001";
-static char cfgFileName[256] = "";
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
@@ -62,8 +61,6 @@
    "owner password (for encrypted files)"},
   {"-upw",    argString,   userPassword,   sizeof(userPassword),
    "user password (for encrypted files)"},
-  {"-cfg",        argString,      cfgFileName,    sizeof(cfgFileName),
-   "configuration file to use in place of .xpdfrc"},
   {"-v",      argFlag,     &printVersion,  0,
    "print copyright and version info"},
   {"-h",      argFlag,     &printHelp,     0,
@@ -108,7 +105,7 @@
   fileName = new GooString(argv[1]);
 
   // read config file
-  globalParams = new GlobalParams(cfgFileName);
+  globalParams = new GlobalParams();
   if (textEncName[0]) {
     globalParams->setTextEncoding(textEncName);
   }

Index: pdftohtml.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdftohtml.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pdftohtml.cc	23 Jan 2006 18:52:48 -0000	1.4
+++ pdftohtml.cc	24 Feb 2007 23:43:35 -0000	1.5
@@ -142,7 +142,7 @@
   //errorInit();
 
   // read config file
-  globalParams = new GlobalParams("");
+  globalParams = new GlobalParams();
 
   if (errQuiet) {
     globalParams->setErrQuiet(errQuiet);

Index: pdftoppm.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdftoppm.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pdftoppm.cc	4 Feb 2006 20:07:08 -0000	1.3
+++ pdftoppm.cc	24 Feb 2007 23:43:35 -0000	1.4
@@ -24,13 +24,11 @@
 static int resolution = 150;
 static GBool mono = gFalse;
 static GBool gray = gFalse;
-static char enableT1libStr[16] = "";
 static char enableFreeTypeStr[16] = "";
 static char antialiasStr[16] = "";
 static char ownerPassword[33] = "";
 static char userPassword[33] = "";
 static GBool quiet = gFalse;
-static char cfgFileName[256] = "";
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
@@ -45,10 +43,6 @@
    "generate a monochrome PBM file"},
   {"-gray",   argFlag,     &gray,          0,
    "generate a grayscale PGM file"},
-#if HAVE_T1LIB_H
-  {"-t1lib",      argString,      enableT1libStr, sizeof(enableT1libStr),
-   "enable t1lib font rasterizer: yes, no"},
-#endif
 #if HAVE_FREETYPE_FREETYPE_H | HAVE_FREETYPE_H
   {"-freetype",   argString,      enableFreeTypeStr, sizeof(enableFreeTypeStr),
    "enable FreeType font rasterizer: yes, no"},
@@ -61,8 +55,6 @@
    "user password (for encrypted files)"},
   {"-q",      argFlag,     &quiet,         0,
    "don't print any messages or errors"},
-  {"-cfg",        argString,      cfgFileName,    sizeof(cfgFileName),
-   "configuration file to use in place of .xpdfrc"},
   {"-v",      argFlag,     &printVersion,  0,
    "print copyright and version info"},
   {"-h",      argFlag,     &printHelp,     0,
@@ -107,12 +99,7 @@
   ppmRoot = argv[2];
 
   // read config file
-  globalParams = new GlobalParams(cfgFileName);
-  if (enableT1libStr[0]) {
-    if (!globalParams->setEnableT1lib(enableT1libStr)) {
-      fprintf(stderr, "Bad '-t1lib' value on command line\n");
-    }
-  }
+  globalParams = new GlobalParams();
   if (enableFreeTypeStr[0]) {
     if (!globalParams->setEnableFreeType(enableFreeTypeStr)) {
       fprintf(stderr, "Bad '-freetype' value on command line\n");

Index: pdftops.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdftops.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pdftops.cc	21 Sep 2006 22:58:31 -0000	1.4
+++ pdftops.cc	24 Feb 2007 23:43:35 -0000	1.5
@@ -29,6 +29,28 @@
 #include "PSOutputDev.h"
 #include "Error.h"
 
+GBool setPSPaperSize(char *size, int &psPaperWidth, int &psPaperHeight) {
+  if (!strcmp(size, "match")) {
+    psPaperWidth = psPaperHeight = -1;
+  } else if (!strcmp(size, "letter")) {
+    psPaperWidth = 612;
+    psPaperHeight = 792;
+  } else if (!strcmp(size, "legal")) {
+    psPaperWidth = 612;
+    psPaperHeight = 1008;
+  } else if (!strcmp(size, "A4")) {
+    psPaperWidth = 595;
+    psPaperHeight = 842;
+  } else if (!strcmp(size, "A3")) {
+    psPaperWidth = 842;
+    psPaperHeight = 1190;
+  } else {
+    return gFalse;
+  }
+  return gTrue;
+}
+
+
 static int firstPage = 1;
 static int lastPage = 0;
 static GBool level1 = gFalse;
@@ -57,7 +79,6 @@
 static char ownerPassword[33] = "\001";
 static char userPassword[33] = "\001";
 static GBool quiet = gFalse;
-static char cfgFileName[256] = "";
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
@@ -116,8 +137,6 @@
    "user password (for encrypted files)"},
   {"-q",          argFlag,     &quiet,          0,
    "don't print any messages or errors"},
-  {"-cfg",        argString,      cfgFileName,    sizeof(cfgFileName),
-   "configuration file to use in place of .xpdfrc"},
   {"-v",          argFlag,     &printVersion,   0,
    "print copyright and version info"},
   {"-h",          argFlag,     &printHelp,      0,
@@ -191,23 +210,13 @@
   fileName = new GooString(argv[1]);
 
   // read config file
-  globalParams = new GlobalParams(cfgFileName);
+  globalParams = new GlobalParams();
   if (paperSize[0]) {
-    if (!globalParams->setPSPaperSize(paperSize)) {
+    if (!setPSPaperSize(paperSize, paperWidth, paperHeight)) {
       fprintf(stderr, "Invalid paper size\n");
       delete fileName;
       goto err0;
     }
-  } else {
-    if (paperWidth) {
-      globalParams->setPSPaperWidth(paperWidth);
-    }
-    if (paperHeight) {
-      globalParams->setPSPaperHeight(paperHeight);
-    }
-  }
-  if (noCrop) {
-    globalParams->setPSCrop(gFalse);
   }
   if (expand) {
     globalParams->setPSExpandSmaller(gTrue);
@@ -218,9 +227,6 @@
   if (noCenter) {
     globalParams->setPSCenter(gFalse);
   }
-  if (duplex) {
-    globalParams->setPSDuplex(duplex);
-  }
   if (level1 || level1Sep || level2 || level2Sep || level3 || level3Sep) {
     globalParams->setPSLevel(level);
   }
@@ -308,12 +314,12 @@
   // write PostScript file
   psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
 			  doc->getCatalog(), firstPage, lastPage, mode,
-			  globalParams->getPSPaperWidth(),
-			  globalParams->getPSPaperHeight(),
-			  globalParams->getPSDuplex());
+			  paperWidth,
+			  paperHeight,
+			  duplex);
   if (psOut->isOk()) {
     doc->displayPages(psOut, firstPage, lastPage, 72, 72,
-		      0, globalParams->getPSCrop(), gFalse, gFalse);
+		      0, !noCrop, gFalse, gFalse);
   } else {
     delete psOut;
     exitCode = 2;

Index: pdftotext.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdftotext.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pdftotext.cc	4 Aug 2006 22:48:09 -0000	1.4
+++ pdftotext.cc	24 Feb 2007 23:43:35 -0000	1.5
@@ -47,7 +47,6 @@
 static char ownerPassword[33] = "\001";
 static char userPassword[33] = "\001";
 static GBool quiet = gFalse;
-static char cfgFileName[256] = "";
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
@@ -74,8 +73,6 @@
    "user password (for encrypted files)"},
   {"-q",       argFlag,     &quiet,         0,
    "don't print any messages or errors"},
-  {"-cfg",     argString,   cfgFileName,    sizeof(cfgFileName),
-   "configuration file to use in place of .xpdfrc"},
   {"-v",       argFlag,     &printVersion,  0,
    "print copyright and version info"},
   {"-h",       argFlag,     &printHelp,     0,
@@ -117,7 +114,7 @@
   fileName = new GooString(argv[1]);
 
   // read config file
-  globalParams = new GlobalParams(cfgFileName);
+  globalParams = new GlobalParams();
   if (textEncName[0]) {
     globalParams->setTextEncoding(textEncName);
   }



More information about the poppler mailing list