diff options
author | Joseph Mingrone <jrm@FreeBSD.org> | 2024-03-02 16:00:16 +0000 |
---|---|---|
committer | Joseph Mingrone <jrm@FreeBSD.org> | 2024-03-02 21:55:30 +0000 |
commit | c9675e79436d9e67e3f1e7795bed009020ded456 (patch) | |
tree | 01cd9f8ab13ac2812be71a254eec6c39c0e4ceb8 /print | |
parent | 7990e837004bd7f4018a7be12de47bfc05ae752f (diff) | |
download | ports-c9675e79436d9e67e3f1e7795bed009020ded456.tar.gz ports-c9675e79436d9e67e3f1e7795bed009020ded456.zip |
print/foomatic-filters: Patch Ghostscript call to count PDF pages
Before this patch, the Ghostscript call for counting PDF pages used the
obsolete "pdfdict". Patch to use "runpdfbegin" instead.
For more information, see Arch Linux bug 62251.
https://bugs.archlinux.org/task/62251
Reported by: Thomas Vaughan <thomas@vaughan.net>
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'print')
-rw-r--r-- | print/foomatic-filters/Makefile | 2 | ||||
-rw-r--r-- | print/foomatic-filters/files/patch-pdf.c | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/print/foomatic-filters/Makefile b/print/foomatic-filters/Makefile index e69d5fa58e72..07fbf57f7db5 100644 --- a/print/foomatic-filters/Makefile +++ b/print/foomatic-filters/Makefile @@ -1,6 +1,6 @@ PORTNAME= foomatic-filters PORTVERSION= 4.0.17 -PORTREVISION= 11 +PORTREVISION= 12 CATEGORIES= print MASTER_SITES= http://www.openprinting.org/download/foomatic/ diff --git a/print/foomatic-filters/files/patch-pdf.c b/print/foomatic-filters/files/patch-pdf.c new file mode 100644 index 000000000000..2abffc572915 --- /dev/null +++ b/print/foomatic-filters/files/patch-pdf.c @@ -0,0 +1,14 @@ +--- pdf.c.orig 2012-07-02 14:50:46 UTC ++++ pdf.c +@@ -46,9 +46,8 @@ static int pdf_count_pages(const char *filename) + int pagecount; + + snprintf(gscommand, 4095, "%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"); |