[poppler] poppler/utils: HtmlOutputDev.cc, 1.5, 1.5.4.1 pdffonts.cc, 1.5, 1.5.2.1 pdfinfo.cc, 1.5, 1.5.2.1 pdftohtml.cc, 1.5, 1.5.2.1 pdftoppm.cc, 1.4, 1.4.2.1 pdftops.cc, 1.5, 1.5.2.1 pdftotext.cc, 1.5, 1.5.2.1

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Apr 6 07:22:25 PDT 2007


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

Modified Files:
      Tag: xpdf302merge
	HtmlOutputDev.cc pdffonts.cc pdfinfo.cc pdftohtml.cc 
	pdftoppm.cc pdftops.cc pdftotext.cc 
Log Message:
The big xpdf 3.02 merge, it's mostly working except
Annot has still to be merged, i'll leave that to jrebetez
DCTStream and FlateStream classes have not been tested
ArthurOutputDev had some code commented, but as it was nto working it's not crucial
UGooString got removed as i got clear it was not needed, yay!
HtmlOutputDev won't detect links as the base outputdev changed signature
Did not test CairoOutputDev but i have 0 knowledge of Cairo so i need someone here anyway
glib frontend has some nasty warnings probably due to changed signatures, have a look
And in all i'm quite happy of the merge as it renders "something" and my kpdf port all it had was crashes :D


Index: HtmlOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/HtmlOutputDev.cc,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -d -r1.5 -r1.5.4.1
--- HtmlOutputDev.cc	19 Mar 2006 17:01:05 -0000	1.5
+++ HtmlOutputDev.cc	6 Apr 2007 14:22:23 -0000	1.5.4.1
@@ -33,7 +33,6 @@
 #include "GlobalParams.h"
 #include "HtmlOutputDev.h"
 #include "HtmlFonts.h"
-#include "UGooString.h"
 
 int HtmlPage::pgNum=0;
 int HtmlOutputDev::imgNum=1;
@@ -1269,6 +1268,8 @@
 
 
 void HtmlOutputDev::drawLink(Link* link,Catalog *cat){
+#warning THIS WON'T WORK OUTPUTDEV DOES NOT HAS drawLink anymore
+/*
   double _x1,_y1,_x2,_y2,w;
   int x1,y1,x2,y2;
   
@@ -1282,7 +1283,7 @@
   GooString* _dest=getLinkDest(link,cat);
   HtmlLink t((double) x1,(double) y2,(double) x2,(double) y1,_dest);
   pages->AddLink(t);
-  delete _dest;
+  delete _dest;*/
 }
 
 GooString* HtmlOutputDev::getLinkDest(Link *link,Catalog* catalog){

Index: pdffonts.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdffonts.cc,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- pdffonts.cc	24 Feb 2007 23:43:35 -0000	1.5
+++ pdffonts.cc	6 Apr 2007 14:22:23 -0000	1.5.2.1
@@ -2,7 +2,7 @@
 //
 // pdffonts.cc
 //
-// Copyright 2001-2003 Glyph & Cog, LLC
+// Copyright 2001-2007 Glyph & Cog, LLC
 //
 //========================================================================
 
@@ -23,17 +23,20 @@
 #include "GfxFont.h"
 #include "Annot.h"
 #include "PDFDoc.h"
-#include "UGooString.h"
 
 static char *fontTypeNames[] = {
   "unknown",
   "Type 1",
   "Type 1C",
+  "Type 1C (OT)",
   "Type 3",
   "TrueType",
+  "TrueType (OT)",
   "CID Type 0",
   "CID Type 0C",
-  "CID TrueType"
+  "CID Type 0C (OT)",
+  "CID TrueType",
+  "CID TrueType (OT)"
 };
 
 static void scanFonts(Dict *resDict, PDFDoc *doc);
@@ -142,8 +145,8 @@
   }
 
   // scan the fonts
-  printf("name                                 type         emb sub uni object ID\n");
-  printf("------------------------------------ ------------ --- --- --- ---------\n");
+  printf("name                                 type              emb sub uni object ID\n");
+  printf("------------------------------------ ----------------- --- --- --- ---------\n");
   fonts = NULL;
   fontsLen = fontsSize = 0;
   for (pg = firstPage; pg <= lastPage; ++pg) {
@@ -280,7 +283,7 @@
   }
 
   // print the font info
-  printf("%-36s %-12s %-3s %-3s %-3s",
+  printf("%-36s %-17s %-3s %-3s %-3s",
 	 name ? name->getCString() : "[none]",
 	 fontTypeNames[font->getType()],
 	 emb ? "yes" : "no",

Index: pdfinfo.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdfinfo.cc,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- pdfinfo.cc	24 Feb 2007 23:43:35 -0000	1.5
+++ pdfinfo.cc	6 Apr 2007 14:22:23 -0000	1.5.2.1
@@ -28,8 +28,8 @@
 #include "PDFDoc.h"
 #include "CharTypes.h"
 #include "UnicodeMap.h"
+#include "PDFDocEncoding.h"
 #include "Error.h"
-#include "UGooString.h"
 
 static void printInfoString(Dict *infoDict, char *key, char *text,
 			    UnicodeMap *uMap);
@@ -198,8 +198,8 @@
 
   // print page size
   for (pg = firstPage; pg <= lastPage; ++pg) {
-    w = doc->getPageMediaWidth(pg);
-    h = doc->getPageMediaHeight(pg);
+    w = doc->getPageCropWidth(pg);
+    h = doc->getPageCropHeight(pg);
     if (multiPage) {
       printf("Page %4d size: %g x %g pts", pg, w, h);
     } else {
@@ -327,7 +327,7 @@
 	    (s1->getChar(i+1) & 0xff);
 	i += 2;
       } else {
-	u = s1->getChar(i) & 0xff;
+	u = pdfDocEncoding[s1->getChar(i) & 0xff];
 	++i;
       }
       n = uMap->mapUnicode(u, buf, sizeof(buf));
@@ -341,7 +341,7 @@
 static void printInfoDate(Dict *infoDict, char *key, char *text) {
   Object obj;
   char *s;
-  int year, mon, day, hour, min, sec;
+  int year, mon, day, hour, min, sec, n;
   struct tm tmStruct;
   char buf[256];
 
@@ -351,8 +351,15 @@
     if (s[0] == 'D' && s[1] == ':') {
       s += 2;
     }
-    if (sscanf(s, "%4d%2d%2d%2d%2d%2d",
-	       &year, &mon, &day, &hour, &min, &sec) == 6) {
+    if ((n = sscanf(s, "%4d%2d%2d%2d%2d%2d",
+		    &year, &mon, &day, &hour, &min, &sec)) >= 1) {
+      switch (n) {
+      case 1: mon = 1;
+      case 2: day = 1;
+      case 3: hour = 0;
+      case 4: min = 0;
+      case 5: sec = 0;
+      }
       tmStruct.tm_year = year - 1900;
       tmStruct.tm_mon = mon - 1;
       tmStruct.tm_mday = day;

Index: pdftohtml.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdftohtml.cc,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- pdftohtml.cc	24 Feb 2007 23:43:35 -0000	1.5
+++ pdftohtml.cc	6 Apr 2007 14:22:23 -0000	1.5.2.1
@@ -29,7 +29,6 @@
 #include "PSOutputDev.h"
 #include "GlobalParams.h"
 #include "Error.h"
-#include "UGooString.h"
 #include "goo/gfile.h"
 
 #ifndef GHOSTSCRIPT

Index: pdftoppm.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdftoppm.cc,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -d -r1.4 -r1.4.2.1
--- pdftoppm.cc	24 Feb 2007 23:43:35 -0000	1.4
+++ pdftoppm.cc	6 Apr 2007 14:22:23 -0000	1.4.2.1
@@ -26,6 +26,7 @@
 static GBool gray = gFalse;
 static char enableFreeTypeStr[16] = "";
 static char antialiasStr[16] = "";
+static char vectorAntialiasStr[16] = "";
 static char ownerPassword[33] = "";
 static char userPassword[33] = "";
 static GBool quiet = gFalse;
@@ -49,6 +50,8 @@
 #endif
   {"-aa",         argString,      antialiasStr,   sizeof(antialiasStr),
    "enable font anti-aliasing: yes, no"},
+  {"-aaVector",   argString,      vectorAntialiasStr, sizeof(vectorAntialiasStr),
+   "enable vector anti-aliasing: yes, no"},
   {"-opw",    argString,   ownerPassword,  sizeof(ownerPassword),
    "owner password (for encrypted files)"},
   {"-upw",    argString,   userPassword,   sizeof(userPassword),
@@ -110,6 +113,11 @@
       fprintf(stderr, "Bad '-aa' value on command line\n");
     }
   }
+  if (vectorAntialiasStr[0]) {
+    if (!globalParams->setVectorAntialias(vectorAntialiasStr)) {
+      fprintf(stderr, "Bad '-aaVector' value on command line\n");
+    }
+  }
   if (quiet) {
     globalParams->setErrQuiet(quiet);
   }

Index: pdftops.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdftops.cc,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- pdftops.cc	24 Feb 2007 23:43:35 -0000	1.5
+++ pdftops.cc	6 Apr 2007 14:22:23 -0000	1.5.2.1
@@ -68,6 +68,7 @@
 static GBool noEmbedTTFonts = gFalse;
 static GBool noEmbedCIDPSFonts = gFalse;
 static GBool noEmbedCIDTTFonts = gFalse;
+static GBool preload = gFalse;
 static char paperSize[15] = "";
 static int paperWidth = 0;
 static int paperHeight = 0;
@@ -115,6 +116,8 @@
    "don't embed CID PostScript fonts"},
   {"-noembcidtt", argFlag, &noEmbedCIDTTFonts,  0,
    "don't embed CID TrueType fonts"},
+  {"-preload",    argFlag,     &preload,        0,
+   "preload images and forms"},
   {"-paper",      argString,   paperSize,       sizeof(paperSize),
    "paper size (letter, legal, A4, A3, match)"},
   {"-paperw",     argInt,      &paperWidth,     0,
@@ -242,6 +245,9 @@
   if (noEmbedCIDTTFonts) {
     globalParams->setPSEmbedCIDTrueType(!noEmbedCIDTTFonts);
   }
+  if (preload) {
+    globalParams->setPSPreload(preload);
+  }
 #if OPI_SUPPORT
   if (doOPI) {
     globalParams->setPSOPI(doOPI);
@@ -319,7 +325,7 @@
 			  duplex);
   if (psOut->isOk()) {
     doc->displayPages(psOut, firstPage, lastPage, 72, 72,
-		      0, !noCrop, gFalse, gFalse);
+		      0, !noCrop, gFalse, gTrue);
   } else {
     delete psOut;
     exitCode = 2;

Index: pdftotext.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/pdftotext.cc,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- pdftotext.cc	24 Feb 2007 23:43:35 -0000	1.5
+++ pdftotext.cc	6 Apr 2007 14:22:23 -0000	1.5.2.1
@@ -30,7 +30,6 @@
 #include "CharTypes.h"
 #include "UnicodeMap.h"
 #include "Error.h"
-#include "UGooString.h"
 
 static void printInfoString(FILE *f, Dict *infoDict, char *key,
 			    char *text1, char *text2, UnicodeMap *uMap);



More information about the poppler mailing list