#! /bin/sh /usr/share/dpatch/dpatch-run ## poppler-based-pdftops-fixes.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad cups-1.3.11~/config-scripts/cups-pdf.m4 cups-1.3.11/config-scripts/cups-pdf.m4 --- cups-1.3.11~/config-scripts/cups-pdf.m4 2009-03-12 22:34:21.000000000 +0100 +++ cups-1.3.11/config-scripts/cups-pdf.m4 2009-07-11 17:09:17.247024891 +0200 @@ -64,6 +64,12 @@ ;; esac +if test "x$CUPS_PDFTOPS" != x; then + if `$CUPS_PDFTOPS -h 2>&1 | grep -q -- -origpagesizes 2>/dev/null`; then + AC_DEFINE(HAVE_PDFTOPS_WITH_ORIGPAGESIZES) + fi +fi + AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS") AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT") AC_SUBST(PDFTOPS) diff -urNad cups-1.3.11~/config.h.in cups-1.3.11/config.h.in --- cups-1.3.11~/config.h.in 2009-03-12 22:34:21.000000000 +0100 +++ cups-1.3.11/config.h.in 2009-07-11 17:09:17.247024891 +0200 @@ -440,6 +440,7 @@ */ #undef HAVE_PDFTOPS +#undef HAVE_PDFTOPS_WITH_ORIGPAGESIZES #define CUPS_PDFTOPS "/usr/bin/pdftops" diff -urNad cups-1.3.11~/filter/pdftops.c cups-1.3.11/filter/pdftops.c --- cups-1.3.11~/filter/pdftops.c 2009-05-22 21:30:50.000000000 +0200 +++ cups-1.3.11/filter/pdftops.c 2009-07-11 17:11:12.447026151 +0200 @@ -303,7 +303,9 @@ } else #ifdef HAVE_PDFTOPS - pdf_argv[pdf_argc++] = (char *)"-level3"; + /* Do not emit PS Level 3 with Poppler, some HP PostScript printers + do not like it. See https://bugs.launchpad.net/bugs/277404. */ + pdf_argv[pdf_argc++] = (char *)"-level2"; #else pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=3"; #endif /* HAVE_PDFTOPS */ @@ -389,7 +391,18 @@ pdf_argv[pdf_argc++] = pdf_width; pdf_argv[pdf_argc++] = pdf_height; #endif /* HAVE_PDFTOPS */ + } +#if defined(HAVE_PDFTOPS) && defined(HAVE_PDFTOPS_WITH_ORIGPAGESIZES) + else + { + /* + * Use the page sizes of the original PDF document, this way documents + * which contain pages of different sizes can be printed correctly + */ + + pdf_argv[pdf_argc++] = (char *)"-origpagesizes"; } +#endif /* HAVE_PDFTOPS && HAVE_PDFTOPS_WITH_ORIGPAGESIZES */ } #ifdef HAVE_PDFTOPS