Skip to content

Commit

Permalink
foomatic-rip: Changed Ghostscript call to count pages in a PDF file s…
Browse files Browse the repository at this point in the history
…o that it works with GS 9.27.
  • Loading branch information
tillkamppeter committed Apr 7, 2019
1 parent 441e617 commit 297cc2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 8 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
NEWS - OpenPrinting CUPS Filters v1.22.4 - 2019-04-05
-----------------------------------------------------

CHANGES IN V1.22.5

- foomatic-rip: Changed Ghostscript call to count pages in a
PDF file to use "runpdfbegin" and not the undocumented
Ghostscript internal "pdfdict", so that it works with
Ghostscript 9.27 and later (Debian bug #926576, Arch Linux
bug #62251).

CHANGES IN V1.22.4

- cups-browsed: Fix broken trailing space removal on
Expand Down
5 changes: 2 additions & 3 deletions filter/foomatic-rip/pdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ static int pdf_count_pages(const char *filename)
size_t bytes;

snprintf(gscommand, CMDLINE_MAX, "%s -dNODISPLAY -q -c "
"'/pdffile (%s) (r) file def pdfdict begin pdffile pdfopen begin "
"(PageCount: ) print pdfpagecount == flush currentdict pdfclose "
"end end quit'",
"'/pdffile (%s) (r) file runpdfbegin (PageCount: ) print "
"pdfpagecount = quit'",
gspath, filename);

FILE *pd = popen(gscommand, "r");
Expand Down

0 comments on commit 297cc2d

Please sign in to comment.