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