e3af14
diff -up cups-filters-1.0.35/filter/pdf.cxx.poppler023 cups-filters-1.0.35/filter/pdf.cxx
e3af14
--- cups-filters-1.0.35/filter/pdf.cxx.poppler023	2015-06-16 15:47:21.870132195 +0100
e3af14
+++ cups-filters-1.0.35/filter/pdf.cxx	2015-06-16 15:47:59.623128579 +0100
e3af14
@@ -17,6 +17,10 @@
e3af14
 #include "pdf.h"
e3af14
 
e3af14
 #include <PDFDoc.h>
e3af14
+#include <config.h>
e3af14
+#ifdef HAVE_CPP_POPPLER_VERSION_H
e3af14
+#include "cpp/poppler-version.h"
e3af14
+#endif
e3af14
 
e3af14
 
e3af14
 extern "C" pdf_t * pdf_load_template(const char *filename)
e3af14
@@ -343,7 +347,11 @@ public:
e3af14
     {
e3af14
     }
e3af14
 
e3af14
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 23
e3af14
+    Goffset getPos()
e3af14
+#else
e3af14
     int getPos()
e3af14
+#endif
e3af14
     {
e3af14
         return this->pos;
e3af14
     }
e3af14
diff -up cups-filters-1.0.35/filter/pdftoijs.cxx.poppler023 cups-filters-1.0.35/filter/pdftoijs.cxx
e3af14
--- cups-filters-1.0.35/filter/pdftoijs.cxx.poppler023	2015-06-16 15:47:21.871132195 +0100
e3af14
+++ cups-filters-1.0.35/filter/pdftoijs.cxx	2015-06-16 15:47:59.623128579 +0100
e3af14
@@ -70,8 +70,13 @@ namespace {
e3af14
 }
e3af14
 
e3af14
 #if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 19
e3af14
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 23
e3af14
+void CDECL myErrorFun(void *data, ErrorCategory category,
e3af14
+    Goffset pos, char *msg)
e3af14
+#else
e3af14
 void CDECL myErrorFun(void *data, ErrorCategory category,
e3af14
     int pos, char *msg)
e3af14
+#endif
e3af14
 {
e3af14
   if (pos >= 0) {
e3af14
     fprintf(stderr, "ERROR (%d): ", pos);
e3af14
@@ -297,19 +302,15 @@ int main(int argc, char *argv[]) {
e3af14
   if (argc == 6) {
e3af14
     /* stdin */
e3af14
     int fd;
e3af14
-    Object obj;
e3af14
-    BaseStream *str;
e3af14
-    FILE *fp;
e3af14
+    char name[BUFSIZ];
e3af14
     char buf[BUFSIZ];
e3af14
     int n;
e3af14
 
e3af14
-    fd = cupsTempFd(buf,sizeof(buf));
e3af14
+    fd = cupsTempFd(name,sizeof(name));
e3af14
     if (fd < 0) {
e3af14
       pdfError(-1,"Can't create temporary file");
e3af14
       exit(1);
e3af14
     }
e3af14
-    /* remove name */
e3af14
-    unlink(buf);
e3af14
 
e3af14
     /* copy stdin to the tmp file */
e3af14
     while ((n = read(0,buf,BUFSIZ)) > 0) {
e3af14
@@ -319,23 +320,10 @@ int main(int argc, char *argv[]) {
e3af14
 	exit(1);
e3af14
       }
e3af14
     }
e3af14
-    if (lseek(fd,0,SEEK_SET) < 0) {
e3af14
-        pdfError(-1,"Can't rewind temporary file");
e3af14
-        close(fd);
e3af14
-	exit(1);
e3af14
-    }
e3af14
-
e3af14
-    if ((fp = fdopen(fd,"rb")) == 0) {
e3af14
-        pdfError(-1,"Can't fdopen temporary file");
e3af14
-        close(fd);
e3af14
-	exit(1);
e3af14
-    }
e3af14
-
e3af14
-    obj.initNull();
e3af14
-//    parsePDFTOPDFComment(fp); // TODO?
e3af14
-    rewind(fp);
e3af14
-    str = new FileStream(fp,0,gFalse,0,&obj);
e3af14
-    doc = new PDFDoc(str);
e3af14
+    close(fd);
e3af14
+    doc = new PDFDoc(new GooString(name));
e3af14
+    /* remove name */
e3af14
+    unlink(name);
e3af14
   } else {
e3af14
     GooString *fileName = new GooString(argv[6]);
e3af14
     /* argc == 7 filenmae is specified */
e3af14
diff -up cups-filters-1.0.35/filter/pdftoopvp/pdftoopvp.cxx.poppler023 cups-filters-1.0.35/filter/pdftoopvp/pdftoopvp.cxx
e3af14
--- cups-filters-1.0.35/filter/pdftoopvp/pdftoopvp.cxx.poppler023	2015-06-16 15:47:21.871132195 +0100
e3af14
+++ cups-filters-1.0.35/filter/pdftoopvp/pdftoopvp.cxx	2015-06-16 15:47:59.624128579 +0100
e3af14
@@ -112,8 +112,13 @@ static int outOnePage(PDFDoc *doc, OPVPO
e3af14
 #define MAX_OPVP_OPTIONS 20
e3af14
 
e3af14
 #if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 19
e3af14
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 23
e3af14
+void CDECL myErrorFun(void *data, ErrorCategory category,
e3af14
+    Goffset pos, char *msg)
e3af14
+#else
e3af14
 void CDECL myErrorFun(void *data, ErrorCategory category,
e3af14
     int pos, char *msg)
e3af14
+#endif
e3af14
 {
e3af14
   if (pos >= 0) {
e3af14
     fprintf(stderr, "ERROR (%d): ", pos);
e3af14
@@ -619,9 +624,6 @@ exit(0);
e3af14
     char *s;
e3af14
     GooString name;
e3af14
     int fd;
e3af14
-    Object obj;
e3af14
-    BaseStream *str;
e3af14
-    FILE *fp;
e3af14
     char buf[4096];
e3af14
     int n;
e3af14
 
e3af14
@@ -633,8 +635,6 @@ exit(0);
e3af14
     }
e3af14
     name.append("/XXXXXX");
e3af14
     fd = mkstemp(name.getCString());
e3af14
-    /* remove name */
e3af14
-    unlink(name.getCString());
e3af14
     if (fd < 0) {
e3af14
       opvpError(-1,"Can't create temporary file");
e3af14
       exitCode = 2;
e3af14
@@ -675,23 +675,10 @@ exit(0);
e3af14
 	goto err0;
e3af14
       }
e3af14
     }
e3af14
-    if (lseek(fd,0,SEEK_SET) < 0) {
e3af14
-	opvpError(-1,"Can't rewind temporary file");
e3af14
-	close(fd);
e3af14
-	exitCode = 2;
e3af14
-	goto err0;
e3af14
-    }
e3af14
-
e3af14
-    if ((fp = fdopen(fd,"rb")) == 0) {
e3af14
-	opvpError(-1,"Can't fdopen temporary file");
e3af14
-	close(fd);
e3af14
-	exitCode = 2;
e3af14
-	goto err0;
e3af14
-    }
e3af14
-
e3af14
-    obj.initNull();
e3af14
-    str = new FileStream(fp,0,gFalse,0,&obj);
e3af14
-    doc = new PDFDoc(str);
e3af14
+    close(fd);
e3af14
+    doc = new PDFDoc(&name);
e3af14
+    /* remove name */
e3af14
+    unlink(name.getCString());
e3af14
   } else {
e3af14
     /* no jcl check */
e3af14
     doc = new PDFDoc(fileName.copy());
e3af14
diff -up cups-filters-1.0.35/filter/pdftoraster.cxx.poppler023 cups-filters-1.0.35/filter/pdftoraster.cxx
e3af14
--- cups-filters-1.0.35/filter/pdftoraster.cxx.poppler023	2015-06-16 15:47:21.871132195 +0100
e3af14
+++ cups-filters-1.0.35/filter/pdftoraster.cxx	2015-06-16 15:47:59.624128579 +0100
e3af14
@@ -185,8 +185,13 @@ namespace {
e3af14
 }
e3af14
 
e3af14
 #if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 19
e3af14
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 23
e3af14
+void CDECL myErrorFun(void *data, ErrorCategory category,
e3af14
+    Goffset pos, char *msg)
e3af14
+#else
e3af14
 void CDECL myErrorFun(void *data, ErrorCategory category,
e3af14
     int pos, char *msg)
e3af14
+#endif
e3af14
 {
e3af14
   if (pos >= 0) {
e3af14
     fprintf(stderr, "ERROR (%d): ", pos);
e3af14
@@ -1762,19 +1767,15 @@ int main(int argc, char *argv[]) {
e3af14
   if (argc == 6) {
e3af14
     /* stdin */
e3af14
     int fd;
e3af14
-    Object obj;
e3af14
-    BaseStream *str;
e3af14
-    FILE *fp;
e3af14
+    char name[BUFSIZ];
e3af14
     char buf[BUFSIZ];
e3af14
     int n;
e3af14
 
e3af14
-    fd = cupsTempFd(buf,sizeof(buf));
e3af14
+    fd = cupsTempFd(name,sizeof(name));
e3af14
     if (fd < 0) {
e3af14
       pdfError(-1,const_cast<char *>("Can't create temporary file"));
e3af14
       exit(1);
e3af14
     }
e3af14
-    /* remove name */
e3af14
-    unlink(buf);
e3af14
 
e3af14
     /* copy stdin to the tmp file */
e3af14
     while ((n = read(0,buf,BUFSIZ)) > 0) {
e3af14
@@ -1784,23 +1785,10 @@ int main(int argc, char *argv[]) {
e3af14
 	exit(1);
e3af14
       }
e3af14
     }
e3af14
-    if (lseek(fd,0,SEEK_SET) < 0) {
e3af14
-        pdfError(-1,const_cast<char *>("Can't rewind temporary file"));
e3af14
-        close(fd);
e3af14
-	exit(1);
e3af14
-    }
e3af14
-
e3af14
-    if ((fp = fdopen(fd,"rb")) == 0) {
e3af14
-        pdfError(-1,const_cast<char *>("Can't fdopen temporary file"));
e3af14
-        close(fd);
e3af14
-	exit(1);
e3af14
-    }
e3af14
-
e3af14
-    obj.initNull();
e3af14
-    parsePDFTOPDFComment(fp);
e3af14
-    rewind(fp);
e3af14
-    str = new FileStream(fp,0,gFalse,0,&obj);
e3af14
-    doc = new PDFDoc(str);
e3af14
+    close(fd);
e3af14
+    doc = new PDFDoc(new GooString(name));
e3af14
+    /* remove name */
e3af14
+    unlink(name);
e3af14
   } else {
e3af14
     GooString *fileName = new GooString(argv[6]);
e3af14
     /* argc == 7 filenmae is specified */
e3af14
diff -up cups-filters-1.0.35/NEWS.poppler023 cups-filters-1.0.35/NEWS