1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
Description: Support Poppler 0.20
Add version 0.20 detection to config.sh
startDoc now takes a PDFDoc not its XRef
findText no longer takes a Catalog argument
TextOutputDev now takes a wholeWord argument
Author: Andy Whitcroft <apw@ubuntu.com>
Author: Pino Toscano <pino@debian.org>
Last-Update: 2013-07-23
Bug-Debian: http://bugs.debian.org/679893
--- a/bindings/poppler_splash_renderer.cc
+++ b/bindings/poppler_splash_renderer.cc
@@ -57,7 +57,13 @@
return;
}
- SYNCHRONIZED(SPLASH_DEV(output_dev)->startDoc(PDF_DOC(poppler_document)->getXRef()));
+ SYNCHRONIZED(SPLASH_DEV(output_dev)->startDoc(
+#ifdef POPPLER_0_20
+ PDF_DOC(poppler_document)
+#else
+ PDF_DOC(poppler_document)->getXRef()
+#endif
+ ));
}
void poppler_splash_device_destroy(void* output_dev)
@@ -92,11 +98,14 @@
(int)sliceX, (int)sliceY,
(int)sliceW, (int)sliceH,
#ifdef POPPLER_0_6
- gFalse, // printing
+ gFalse // printing
#else
- NULL, // Links
+ NULL // Links
+#endif
+#ifndef POPPLER_0_20
+ , PDF_DOC(poppler_document)->getCatalog()
#endif
- PDF_DOC(poppler_document)->getCatalog()));
+ ));
return 1;
}
--- a/config.sh
+++ b/config.sh
@@ -64,6 +64,11 @@
POPPLER_VERSION="POPPLER_0_6"
fi
+${PKG_CONFIG} --atleast-version=0.20.0 poppler
+if [ $? -eq 0 ]; then
+ POPPLER_VERSION="POPPLER_0_20"
+fi
+
echo $POPPLER_VERSION
# include freetype, just to be sure
--- a/bindings/GNUmakefile
+++ b/bindings/GNUmakefile
@@ -53,4 +53,8 @@
bindings_CCFLAGS += -DPOPPLER_0_6
endif
+ifeq ($(POPPLER_0_20), YES)
+ bindings_CCFLAGS += -DPOPPLER_0_20
+endif
+
include $(GNUSTEP_MAKEFILES)/subproject.make
--- a/bindings/poppler_text.cc
+++ b/bindings/poppler_text.cc
@@ -29,7 +29,11 @@
void* poppler_text_device_create(int use_phys_layout, int use_raw_text_order, int append)
{
BEGIN_SYNCHRONIZED;
- void* textDevice = new TextOutputDev(NULL, use_phys_layout, use_raw_text_order, append);
+ void* textDevice = new TextOutputDev(NULL, use_phys_layout,
+#ifdef POPPLER_0_20
+ 0,
+#endif
+ use_raw_text_order, append);
END_SYNCHRONIZED;
return textDevice;
@@ -56,11 +60,14 @@
#endif
crop,
#ifdef POPPLER_0_6
- gFalse, // printing
+ gFalse // printing
#else
- NULL, // links
+ NULL // links
+#endif
+#ifndef POPPLER_0_20
+ ,PDF_DOC(poppler_document)->getCatalog()
#endif
- PDF_DOC(poppler_document)->getCatalog()));
+ ));
return 1;
}
@@ -79,6 +86,9 @@
#ifndef POPPLER_0_4 // 0.5, 0.6
gTrue, gFalse,
#endif
+#ifdef POPPLER_0_20
+ gFalse,
+#endif
x_min, y_min, x_max, y_max);
END_SYNCHRONIZED;
|