Blame SOURCES/0001-foomatic-rip-Changed-Ghostscript-call-to-count-pages.patch

64b4f4
From 297cc2decc53e0b08eb03049fce375db33df2131 Mon Sep 17 00:00:00 2001
64b4f4
From: Till Kamppeter <till.kamppeter@gmail.com>
64b4f4
Date: Sun, 7 Apr 2019 16:34:16 +0200
64b4f4
Subject: [PATCH] foomatic-rip: Changed Ghostscript call to count pages in a
64b4f4
 PDF file so that it works with GS 9.27.
64b4f4
64b4f4
diff --git a/filter/foomatic-rip/pdf.c b/filter/foomatic-rip/pdf.c
64b4f4
index 9c3979bb..bc739bd8 100644
64b4f4
--- a/filter/foomatic-rip/pdf.c
64b4f4
+++ b/filter/foomatic-rip/pdf.c
64b4f4
@@ -47,9 +47,8 @@ static int pdf_count_pages(const char *filename)
64b4f4
     size_t bytes;
64b4f4
 
64b4f4
     snprintf(gscommand, CMDLINE_MAX, "%s -dNODISPLAY -q -c "
64b4f4
-	     "'/pdffile (%s) (r) file def pdfdict begin pdffile pdfopen begin "
64b4f4
-	     "(PageCount: ) print pdfpagecount == flush currentdict pdfclose "
64b4f4
-	     "end end quit'",
64b4f4
+	     "'/pdffile (%s) (r) file runpdfbegin (PageCount: ) print "
64b4f4
+	     "pdfpagecount = quit'",
64b4f4
 	     gspath, filename);
64b4f4
 
64b4f4
     FILE *pd = popen(gscommand, "r");