poppler: use new PDF version methods
authorAsbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>
Mon, 7 Jun 2010 18:43:11 +0000 (18:43 +0000)
committerAsbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>
Wed, 16 Jun 2010 14:36:56 +0000 (14:36 +0000)
lib/pdf/pdf.cc

index f148424..f04c396 100644 (file)
@@ -4,7 +4,12 @@
 #include "../gfxsource.h"
 #include "../devices/rescale.h"
 #include "../log.h"
-#include "config.h"
+#include "../../config.h"
+#ifdef HAVE_POPPLER
+  #include <poppler-config.h>
+#else
+  #include "xpdf/config.h"
+#endif
 #include "GlobalParams.h"
 #include "InfoOutputDev.h"
 #include "GFXOutputDev.h"
@@ -355,7 +360,11 @@ char* pdf_doc_getinfo(gfxdocument_t*doc, const char*name)
     else if(!strcmp(name, "oktoaddnotes")) return strdup(i->doc->okToAddNotes() ? "yes" : "no");
     else if(!strcmp(name, "version")) { 
         char buf[32];
+#ifdef HAVE_POPPLER
+        sprintf(buf, "%d.%d", i->doc->getPDFMajorVersion(), i->doc->getPDFMinorVersion());
+#else
         sprintf(buf, "%.1f", i->doc->getPDFVersion());
+#endif
         return strdup(buf);
     }
     return strdup("");