[cups.general] Suppress Ghostscript output comments from Adobe drivers

Till Kamppeter till.kamppeter at gmail.com
Tue Sep 5 15:03:04 PDT 2006


Paul Galbraith wrote:
>> Paul Galbraith wrote:
>>> I'm using cups 1.1 on OpenBSD with AFPL GhostScript 8.14 ... on my Windows machine I'm using Adobe's PS drivers, which apparently insert ps commands that cause ghostscript to output page numbers and info like this to stdout:
>>>
>>> %%[ ProductName: AFPL Ghostscript ]%%
>>> %%[Page: 1]%%
>>> %%[LastPage]%%
>>>
>>> Unfortunately when I try to print from Windows through Samba & CUPS, these comments are getting mixed into the output stream sent to my printer, which is not good.
>>>
>>> I'd like to change the way cups executes gs, so that gs will output to a temp file, and stdout gets sent to /dev/null (to prevent the above useless comments from entering the print steam), and then the temp file can simply be sent to the printer.  Can cups be configured to do this, rather than piping gs output directly to the printer?
>>>
>>> An alternative seems to come from here:
>>>
>>> http://groups.google.ca/group/comp.lang.postscript/browse_frm/thread/d60d94ffcf634571/a82a811551d68e13?lnk=st&q=ghostscript+suppress+output&rnum=17#a82a811551d68e13
>>>
>>> Basically, it sounds like I can add a short postscript code snippet to the ghostscript search path and get gs to execute it along with the standard print job (please excuse my lack of ps/gs knowledge!).  This seems easy enough, except that again I can't figure out how to alter the cups print command to process the new code library file AND the ps file with my print job, since cups pipes the print job directly to gs ...
>>>
>>> Surely this must be a FAQ, but I'm afraid that after hours and hours of searching I can't find a way to do this with my limited understanding of cups and gs.  Can anyone help?  Thanks,
>>>
>>> Paul
>> There are probably several methods to fix your problem, but to give you any specific advice, you
>> should tell us how your printer is configured, especially where Ghostscript comes into play.
>>
>> Helge
>>
> 
> I'm using Samba (2.2) with CUPS (1.1) as a print server on OpenBSD.  Everything seems to be configured and working, with the exception of the extraneous ghostscript comments being inserted into the stream sent to the printer.
> 
> Samba is configured with "printing = cups" which afaik, basically means that it's calling CUPS' lpr with "-oraw" and passing in a spooled ps file that the Adobe Win32 print drivers have created.  I have a .ppd file for my printer which I've obtained from linuxprinting.org:
> 
> http://www.linuxprinting.org/ppd-o-matic.cgi?driver=hpijs&printer=HP-PhotoSmart_P1100&show=1
> 
> In it I see the "FoomaticRIPCommandLine" entry which I believe is the source of the ghostscript command that gets executed by CUPS:
> 
> gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs sIjsServer=hpijs%A%B%C -dIjsUseOutputFD%Z -sOutputFile=- -
> 
> If I execute this myself using the spooled ps file from Samba instead of stdin, sure enough, the unwanted comments are dumped to the console.
> 
> How can I get CUPS to execute the gs command so that junk sent to the console does not get piped directly to my printer?
> 

Make sure that you have foomatic-gswrapper in your /usr/bin directory.
This program is automatically used by foomatic-rip (the CUPS filter
which is used in your case) to modify the GhostScript command line in a
way that these comments are redirected to standard error, so that they
get into the CUPS error_log file ("LogLevel debug" only) and not to the
printer.

If you have problems with foomatic-gswrapper, replace it by the newest
version from:

http://www.linuxprinting.org/gswrapper.html

I have done improvements on it in the last days.

   Till





More information about the cups mailing list