diff options
Diffstat (limited to 'filter/sys5ippprinter.c')
-rw-r--r-- | filter/sys5ippprinter.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/filter/sys5ippprinter.c b/filter/sys5ippprinter.c index 6743f4486..6635aca78 100644 --- a/filter/sys5ippprinter.c +++ b/filter/sys5ippprinter.c @@ -267,6 +267,9 @@ main(int argc, /* I - Number of command-line args */ /* PWG Raster output */ set_option_in_str(argv_nt[5], optbuflen, "MediaClass", NULL); set_option_in_str(argv_nt[5], optbuflen, "media-class", "PwgRaster"); + /* Page logging into page_log is not done by gstoraster/pdftoraster, + so let it be done by pdftopdf */ + set_option_in_str(argv_nt[5], optbuflen, "page-logging", "on"); if (filter_present("gstoraster") && access(CUPS_GHOSTSCRIPT, X_OK) == 0) cupsArrayAdd(filter_chain, "gstoraster"); else @@ -285,10 +288,17 @@ main(int argc, /* I - Number of command-line args */ } } else if (strcasestr(val, "pdf")) + { output_format = PDF; + /* Page logging into page_log has to be done by pdftopdf */ + set_option_in_str(argv_nt[5], optbuflen, "page-logging", "on"); + } else if (strcasestr(val, "postscript")) { output_format = POSTSCRIPT; + /* Page logging into page_log is done by pstops, so no need by + pdftopdf */ + set_option_in_str(argv_nt[5], optbuflen, "page-logging", "off"); if (filter_present("pdftops")) { cupsArrayAdd(filter_chain, "pdftops"); @@ -324,7 +334,12 @@ main(int argc, /* I - Number of command-line args */ { output_format = PCLXL; if (filter_present("gstopxl") && access(CUPS_GHOSTSCRIPT, X_OK) == 0) + { cupsArrayAdd(filter_chain, "gstopxl"); + /* Page logging into page_log is not done by gstopxl, + so let it be done by pdftopdf */ + set_option_in_str(argv_nt[5], optbuflen, "page-logging", "on"); + } else { fprintf(stderr, @@ -358,6 +373,9 @@ main(int argc, /* I - Number of command-line args */ margins */ set_option_in_str(argv_nt[5], optbuflen, "MediaClass", NULL); set_option_in_str(argv_nt[5], optbuflen, "media-class", ""); + /* Page logging into page_log is done by rastertopclx, so no need by + pdftopdf */ + set_option_in_str(argv_nt[5], optbuflen, "page-logging", "off"); /* Does the client send info about margins? */ if (!get_option_in_str(argv_nt[5], "media-left-margin", 0) && !get_option_in_str(argv_nt[5], "media-right-margin", 0) && @@ -544,6 +562,17 @@ exec_filter(const char *filter, /* I - Filter to execute */ } } + /* Send stderr to the Nirwana if we are running gziptoany, as + gziptoany emits a false "PAGE: 1 1" */ + if (strcasestr(filter, "gziptoany")) { + if ((fd = open("/dev/null", O_RDWR)) > 2) + { + dup2(fd, 2); + close(fd); + } + fcntl(2, F_SETFL, O_NDELAY); + } + if ((fd = open("/dev/null", O_RDWR)) > 3) { dup2(fd, 3); |