diff options
author | Till Kamppeter <till.kamppeter@gmail.com> | 2012-03-14 21:06:50 +0100 |
---|---|---|
committer | Till Kamppeter <till.kamppeter@gmail.com> | 2012-03-14 21:06:50 +0100 |
commit | 44c15cac73781fe1ff2a551cb8aff618f5e2436a (patch) | |
tree | 4360dd110f5bdd291c52a17a9899f49204ae52c7 /foomaticrip.c | |
parent | 5fe67f8d40bd656490d63d830c06fc576578a93f (diff) | |
parent | 6c19572dc706a05f45ba200b12d3b4bfdafe2206 (diff) |
Merge tag 'upstream/4.0.14'
Upstream version 4.0.14
Diffstat (limited to 'foomaticrip.c')
-rw-r--r-- | foomaticrip.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/foomaticrip.c b/foomaticrip.c index 799a259..3fdffe4 100644 --- a/foomaticrip.c +++ b/foomaticrip.c @@ -1043,28 +1043,33 @@ int print_file(const char *filename, int convert) filename = tmpfilename; } - /* If the spooler is CUPS we remove the /usr/lib/cups/filter - (CUPS filter directory, can be different, but ends with - "/cups/filter") which CUPS adds to the beginning of $PATH, - so that Poppler's/XPDF's pdftops filter is called and not - the one of CUPS, as the one of CUPS has a different command - line and does undesired page management operations. + /* If the spooler is CUPS we use the pdftops filter of CUPS, + to have always the same PDF->PostScript conversion method + in the whole printing environment, including incompatibility + workarounds in the CUPS filter (so this way we also have to + maintain all these quirks only once). + The "-dNOINTERPOLATE" makes Ghostscript rendering significantly faster. + Note that Ghostscript's "pswrite" output device turns text into bitmaps and therefore produces huge PostScript files. In addition, this output device is deprecated. Therefore we use "ps2write". + We give priority to Ghostscript here and use Poppler if Ghostscript is not available. */ - snprintf(pdf2ps_cmd, PATH_MAX, - "gs -q -sstdout=%%stderr -sDEVICE=ps2write -sOutputFile=- " - "-dBATCH -dNOPAUSE -dPARANOIDSAFER -dNOINTERPOLATE %s 2>/dev/null || " - "%spdftops -level2 -origpagesizes %s - 2>/dev/null", - filename, - (spooler == SPOOLER_CUPS ? - "PATH=${PATH#*/cups/filter:} " : ""), - filename); + if (spooler == SPOOLER_CUPS) + snprintf(pdf2ps_cmd, PATH_MAX, + "pdftops '%s' '%s' '%s' '%s' '%s' '%s'", + job->id, job->user, job->title, "1", job->optstr, + filename); + else + snprintf(pdf2ps_cmd, PATH_MAX, + "gs -q -sstdout=%%stderr -sDEVICE=ps2write -sOutputFile=- " + "-dBATCH -dNOPAUSE -dPARANOIDSAFER -dNOINTERPOLATE %s 2>/dev/null || " + "pdftops -level2 -origpagesizes %s - 2>/dev/null", + filename, filename); renderer_pid = start_system_process("pdf-to-ps", pdf2ps_cmd, &in, &out); |