Index: config-scripts/cups-pdf.m4 =================================================================== --- config-scripts/cups-pdf.m4 (revision 9747) +++ config-scripts/cups-pdf.m4 (working copy) @@ -1,9 +1,9 @@ dnl dnl "$Id$" dnl -dnl PDF filter configuration stuff for the Common UNIX Printing System (CUPS). +dnl PDF filter configuration stuff for CUPS. dnl -dnl Copyright 2007-2009 by Apple Inc. +dnl Copyright 2007-2011 by Apple Inc. dnl Copyright 2006 by Easy Software Products, all rights reserved. dnl dnl These coded instructions, statements, and computer programs are the @@ -80,11 +80,25 @@ esac if test "x$CUPS_PDFTOPS" != x; then - if `$CUPS_PDFTOPS -h 2>&1 | grep -q -- -origpagesizes 2>/dev/null`; then + AC_MSG_CHECKING(whether pdftops supports -origpagesizes) + if ($CUPS_PDFTOPS -h 2>&1 | grep -q -- -origpagesizes); then + AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PDFTOPS_WITH_ORIGPAGESIZES) + else + AC_MSG_RESULT(no) fi fi +if test "x$CUPS_GHOSTSCRIPT" != x; then + AC_MSG_CHECKING(whether gs supports the ps2write device) + if ($CUPS_GHOSTSCRIPT -h 2>&1 | grep -q ps2write); then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GHOSTSCRIPT_PS2WRITE) + else + AC_MSG_RESULT(no) + fi +fi + AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS") AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT") AC_SUBST(PDFTOPS) Index: filter/pdftops.c =================================================================== --- filter/pdftops.c (revision 9747) +++ filter/pdftops.c (working copy) @@ -276,7 +276,11 @@ pdf_argv[2] = (char *)"-dNOPAUSE"; pdf_argv[3] = (char *)"-dBATCH"; pdf_argv[4] = (char *)"-dSAFER"; +# ifdef HAVE_GHOSTSCRIPT_PS2WRITE + pdf_argv[5] = (char *)"-sDEVICE=ps2write"; +# else pdf_argv[5] = (char *)"-sDEVICE=pswrite"; +# endif /* HAVE_GHOSTSCRIPT_PS2WRITE */ pdf_argv[6] = (char *)"-sOUTPUTFILE=%stdout"; pdf_argc = 7; #endif /* HAVE_PDFTOPS */ Index: config.h.in =================================================================== --- config.h.in (revision 9747) +++ config.h.in (working copy) @@ -510,6 +510,7 @@ */ #undef HAVE_GHOSTSCRIPT +#undef HAVE_GHOSTSCRIPT_PS2WRITE #define CUPS_GHOSTSCRIPT "/usr/bin/gs"