Discussion:
How to send EOT (\004) and the end of PS job
Anonymous
2005-05-12 13:24:56 UTC
Permalink
Hi,

I am having problem with printing PS in a new Lexmark T430 printer. After a PS file gets printed, the printer shows "Waiting" for about 20 seconds and only then shows "Ready" and can print another job.

After some experiments I have found that it requires the EOT code (\004) to be sent after the job to mark its end. It seems, however, that the CUPS ignores completely the "Send End-of-Transmission (EOT)" setting in the printer configuration (printtool a.k.a. system-config-printer in Linux FC2). Checking or unchecking the appropriate box in the "driver options" panel does not change anything. Also, when I temporarily changed the device to print to a file (/tmp/lp), it did not show any \004 at the end.

I am not sure whether this is Fedora's printtool or CUPS problem. It would be helpful, however, if somebody could tell me where and how should the CUPS configuration be set that the EOT should be sent at the end of a PS job.

regards, Michal.

PS. The versions of packages I use are:
cups-1.1.20-11.9
foomatic-3.0.1-3
Omni-foomatic-0.9.1-6
Michael Sweet
2005-05-12 14:16:49 UTC
Permalink
Post by Anonymous
...
I am not sure whether this is Fedora's printtool or CUPS problem. It
would be helpful, however, if somebody could tell me where and how
should the CUPS configuration be set that the EOT should be sent at
the end of a PS job.
That setting is not used by CUPS - it is a holdover in the Fedora
tool from the old LPRng days...

What CUPS looks for is the JCLEnd attribute in the PPD file.
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
Anonymous
2005-05-12 14:56:33 UTC
Permalink
Post by Michael Sweet
Post by Anonymous
...
I am not sure whether this is Fedora's printtool or CUPS problem. It
would be helpful, however, if somebody could tell me where and how
should the CUPS configuration be set that the EOT should be sent at
the end of a PS job.
That setting is not used by CUPS - it is a holdover in the Fedora
tool from the old LPRng days...
What CUPS looks for is the JCLEnd attribute in the PPD file.
Well, I have found refences to JCL... in docs and added <04>
in the last of the following lines (in the imported file):

*JCLBegin: "<1B>%-***@PJL JOB<0A>@PJL SET LMULTIPAGEPRINT=OFF<0A>"
*JCLToPSInterpreter: "@PJL ENTER LANGUAGE = Postscript <0A>"
*JCLEnd: "<04><1B>%-***@PJL EOJ <0A><1B>%-12345X"

Then I re-imported the file (is it OK to re-import, did it really overwrite the previous entries?) but that did not change anything.

I can see no *JCL line in the /etc/cups/ppd/lex.ppd file autogenerated by the system. Instead, I found the following there:

*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
..
*FoomaticRIPCommandLine: "cat %A%Z"

which (AFAIU it right) means that a PS job is simply cat-ed to the printer, with no PJL commands added. This agrees with what I can see when I set the printer device to a file.

I have (temporarily and improperly) solved the problem by adding by hand 'echo -en &quot;\004&quot' to the FoomaticRIPCommandLine. Now my T430 Lexmark printer gets "Ready" immediately after printing the job. This file, however, gets overwritten every time I change anything in the printer configuration (even when this very printer does not change), so this is surely not the way it should be done.

regards, Michal.
Michael Sweet
2005-05-12 15:27:27 UTC
Permalink
Post by Anonymous
...
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
..
*FoomaticRIPCommandLine: "cat %A%Z"
OK, REMOVE THIS JUNK!

Just use the standard PPD file. Foomatic causes far more problems
than it solves...
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
Helge Blischke
2005-05-12 15:39:54 UTC
Permalink
Post by Anonymous
Post by Michael Sweet
Post by Anonymous
...
I am not sure whether this is Fedora's printtool or CUPS problem. It
would be helpful, however, if somebody could tell me where and how
should the CUPS configuration be set that the EOT should be sent at
the end of a PS job.
That setting is not used by CUPS - it is a holdover in the Fedora
tool from the old LPRng days...
What CUPS looks for is the JCLEnd attribute in the PPD file.
Well, I have found refences to JCL... in docs and added <04>
Then I re-imported the file (is it OK to re-import, did it really overwrite the previous entries?) but that did not change anything.
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
..
*FoomaticRIPCommandLine: "cat %A%Z"
which (AFAIU it right) means that a PS job is simply cat-ed to the printer, with no PJL commands added. This agrees with what I can see when I set the printer device to a file.
I have (temporarily and improperly) solved the problem by adding by hand 'echo -en &quot;\004&quot' to the FoomaticRIPCommandLine. Now my T430 Lexmark printer gets "Ready" immediately after printing the job. This file, however, gets overwritten every time I change anything in the printer configuration (even when this very printer does not change), so this is surely not the way it should be done.
regards, Michal.
Try to modify the *JCLEnd statement by replacing the last "%-12345X" by
"<04>" (without the
quotes).

Helge
--
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
Till Kamppeter
2005-05-12 15:47:06 UTC
Permalink
Post by Anonymous
Post by Michael Sweet
Post by Anonymous
...
I am not sure whether this is Fedora's printtool or CUPS problem. It
would be helpful, however, if somebody could tell me where and how
should the CUPS configuration be set that the EOT should be sent at
the end of a PS job.
That setting is not used by CUPS - it is a holdover in the Fedora
tool from the old LPRng days...
What CUPS looks for is the JCLEnd attribute in the PPD file.
Well, I have found refences to JCL... in docs and added <04>
Then I re-imported the file (is it OK to re-import, did it really overwrite the previous entries?) but that did not change anything.
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
..
*FoomaticRIPCommandLine: "cat %A%Z"
which (AFAIU it right) means that a PS job is simply cat-ed to the printer, with no PJL commands added. This agrees with what I can see when I set the printer device to a file.
I have (temporarily and improperly) solved the problem by adding by hand 'echo -en &quot;\004&quot' to the FoomaticRIPCommandLine. Now my T430 Lexmark printer gets "Ready" immediately after printing the job. This file, however, gets overwritten every time I change anything in the printer configuration (even when this very printer does not change), so this is surely not the way it should be done.
It should also work when you simply add the *JCL... lines. If the
printer does not support PJL, simply try to add

------------------------------------------------------------------------------
*JCLBegin: ""
*JCLToPSInterpreter: ""
*JCLEnd: "<04>"
------------------------------------------------------------------------------

This should work independent whether the PPD file is a Foomatic PPD file
or not.

Where does your PPD file come from? Usually Foomatic is used to make the
PostScript input be passed through some filter which is not a CUPS
filter (and therefore it cannot be called directly by CUPS). Your PPD
file makes foomatic-rip passing the data through a neutral filter:
Michal Szymanski
2005-05-13 07:19:10 UTC
Permalink
Post by Michael Sweet
Post by Anonymous
...
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
..
*FoomaticRIPCommandLine: "cat %A%Z"
OK, REMOVE THIS JUNK!
Just use the standard PPD file. Foomatic causes far more problems
than it solves...
What do you mean by 'standard PPD'? I am also exprimenting with my printer (Lexmark T430) configured as T616 (closest entry in the configuration tool). The PPD file generated for T616 says:

*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
..
*FoomaticRIPCommandLine: "level=%D; printf &quot;%%!\n%%%% %%%%\n%C&qu&&
ot;; if (( $level &gt; 0 )); then if (( $level &lt; 99 )); then level=&&
&quot; -dLanguageLevel=$level&quot;; else level=&quot;&quot;; fi; gs -&&
q -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite$level%A%Z -sOutpu&&
tFile=- -; else cat; fi"

I am not sure how to decipher all those if-s but from what I see in the output (when the device is set to a file instead of the printer), for PS jobs it just cat-s them. So the original problem with the job end persists unless I manually add
/bin/echo -en &quot;\004&quot;;
just before the last 'fi' in the above command line.

Michal
Post by Michael Sweet
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
Till Kamppeter
2005-05-13 10:57:04 UTC
Permalink
The PPDs you are using are generic PostScript PPDs. They only offer very
basic settings and are only intended for the case that you do not have
the printer-specific PPD from the manufacturer at hand.

Every manufacturer makes PPD files specific to the printer model for
each of their PostScript printers. These files make available all
user-settable options (and not only paper size, resolution, and paper
tray) and also even apply workarounds to small incompatibilities of the
printer's PostScript. So look for the PPD file on the printer's driver
CD, on a Windows box with a queue for this printer set up, or on the
manufacturer's web site. Lexmark gives good Linux support for laser
printers, so you probably will find a PPD file on their site (or a
driver package containing the PPD).

Are you using Fedora or Red Hat? These distros do not deliver you any
manufacturer-supplied PPD (in contrary to Mandriva and SuSE), the
printconf-gui also does not support ready-built PPDs, but only the
Foomatic XML database. So you need to put the Lexmark PPD into
/usr/share/cups/model, "killall -HUP cupsd", and then use the KDE
Printing Manager or the CUPS web interface to set up a print queue.

On linuxprinting.org I will do a better integration of
manufacturer-supplied PPD files soon, so that they get more easily
packageable for distros, more easily maintainable, automatically being
used by the Foomatic tools, and if only a PPD file is submitted to
linuxprinting.org, a printer entry in the database will be generated
automatically.

Till
Post by Anonymous
Post by Michael Sweet
Post by Anonymous
...
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
..
*FoomaticRIPCommandLine: "cat %A%Z"
OK, REMOVE THIS JUNK!
Just use the standard PPD file. Foomatic causes far more problems
than it solves...
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
..
*FoomaticRIPCommandLine: "level=%D; printf &quot;%%!\n%%%% %%%%\n%C&qu&&
&quot; -dLanguageLevel=$level&quot;; else level=&quot;&quot;; fi; gs -&&
q -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite$level%A%Z -sOutpu&&
tFile=- -; else cat; fi"
I am not sure how to decipher all those if-s but from what I see in the output (when the device is set to a file instead of the printer), for PS jobs it just cat-s them. So the original problem with the job end persists unless I manually add
/bin/echo -en &quot;\004&quot;;
just before the last 'fi' in the above command line.
Michal
Post by Michael Sweet
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
_______________________________________________
cups mailing list
http://lists.easysw.com/mailman/listinfo/cups
Johannes Meixner
2005-05-13 13:43:51 UTC
Permalink
Hello,

a bit off topic...
... if only a PPD file is submitted to linuxprinting.org,
a printer entry in the database will be generated automatically.
Great!
I assume it works based upon the manufacturer and model strings
and therefore it would work even for non-PostScript printer PPDs
in particular for Foomatic-compatible PPDs which are external
generated (e.g. at printer manufacturers)?
Foomatic causes far more problems than it solves...
I disagree.

Without Foomatic we would not have switched to CUPS when we did it
because when we switched to CUPS, it was Foomatic which provided
the same support for all those various kind of cheap little inkjet
printers which had worked before with the various kind of Ghostscript
drivers (up to the various weird postfilters).

One might call Foomatic a (perhaps complicated) workaround for
a native CUPS driver but I think it is much better to accept such
a workaround than having no support at all when there is no native
CUPS driver available.



Kind Regards
Johannes Meixner
--
SUSE LINUX Products GmbH, Maxfeldstrasse 5 Mail: jsmeix-***@public.gmane.org
90409 Nuernberg, Germany WWW: http://www.suse.de/
Michael Sweet
2005-05-13 14:55:17 UTC
Permalink
Post by Johannes Meixner
Hello,
a bit off topic...
... if only a PPD file is submitted to linuxprinting.org,
a printer entry in the database will be generated automatically.
Great!
I assume it works based upon the manufacturer and model strings
and therefore it would work even for non-PostScript printer PPDs
in particular for Foomatic-compatible PPDs which are external
generated (e.g. at printer manufacturers)?
FWIW, we already have this in place on the CUPS site, and the PPD
database is available via Subversion...

http://www.cups.org/ppd.php
http://svn.easysw.com/public/ppd/trunk/
Post by Johannes Meixner
Foomatic causes far more problems than it solves...
I disagree.
Without Foomatic we would not have switched to CUPS when we did it
because when we switched to CUPS, it was Foomatic which provided
the same support for all those various kind of cheap little inkjet
printers which had worked before with the various kind of Ghostscript
drivers (up to the various weird postfilters).
I agree that Foomatic helps for older printers that are only supported
via a Ghostscript-based driver, however the current version also
attempts to support all PostScript printers, too, and often leads to
problems... All you have to do is look at the number of problems
people report in the Foomatic drivers vs. say the sample drivers in
CUPS or the native Gimp/Gutenprint drivers.

In short, I liked Foomatic when it was a reliable wrapper for non-PS
Ghostscript drivers. It did one thing, and it did it well.
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Publishing Software http://www.easysw.com
Michael Sweet
2005-05-13 11:36:34 UTC
Permalink
Post by Michal Szymanski
...
What do you mean by 'standard PPD'? I am also exprimenting with my
printer (Lexmark T430) configured as T616 (closest entry in the
By "standard PPD", I mean the vendor's original PPD file, not the
Foomatic version. You'll find this on the Windows driver CD that
came with the printer.
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Publishing Software http://www.easysw.com
Michal Szymanski
2005-05-13 07:51:23 UTC
Permalink
Post by Helge Blischke
Post by Anonymous
Post by Michael Sweet
What CUPS looks for is the JCLEnd attribute in the PPD file.
Well, I have found refences to JCL... in docs and added <04>
Then I re-imported the file (is it OK to re-import, did it really
overwrite the previous entries?) but that did not change anything.
Try to modify the *JCLEnd statement by replacing the last "%-12345X"
by "<04>" (without the quotes).
Did not help. I am afraid the problem is that the JCL commands do not get through to the PPD file generated by the configuration tool. I guess that if they did, and the PS job would reach the printer embedded in PJL JOB Begin/End directives, the problem with waiting-to-get-ready would disappear.

No it seems that the printer is not treated as a PJL-capable printer.
The same happens with the closest 'native' CUPS driver, Lexmark Optra T616 which otherwise works fine with my T420 and T430 printers (except for the lack of EOT in the case of T430 - T420 somehow manages without it). But I cannot send PCL jobs to the printes - these just disappear.

I would be grateful for a hint how to choose the printer driver to allow both PS and PCL jobs, duplex/simplex and 600/1200 dpi resolution.

regards, Michal.
Loading...