Discussion:
Setting the CUPS parameters from the file to be printed
Scott Vetter
2013-02-10 05:25:39 UTC
Permalink
Is it possible to set the printer options with the input file (i.e. file to be printed)? For example, I have a file to be printed and would like the first line or two would contain how the printer's option to be set. Is this possible? If so, how?

Thanks!
Helge Blischke
2013-02-10 09:59:29 UTC
Permalink
Post by Scott Vetter
Is it possible to set the printer options with the input file (i.e. file
to be printed)? For example, I have a file to be printed and would like
the first line or two would contain how the printer's option to be set.
Is this possible? If so, how?
Thanks!
In case of PostScript jobs, yes. Insert immediately after the line starting
with
%!
or
%!PS-Adobe
(which specifies the following is a PostScript job) one or more lines of the
form
%cupsJobTicket: attr1=value1 attr2=value2 ... attrN=valueN

where attrx=valuex denote (nearly) any option which can be specified in a lp
or lpr command, like
media=A4
or
sides=two-sided-long-edge
etc.

See also
http://www.cups.org/documentation.php/doc-1.6/spec-postscript.html#OPTIONS

THis feature has been implemented at first (as far as I know) in cups 1.3.

Helge
Scott Vetter
2013-02-10 14:45:08 UTC
Permalink
Post by Helge Blischke
Post by Scott Vetter
Is it possible to set the printer options with the input file (i.e. file
to be printed)? For example, I have a file to be printed and would like
the first line or two would contain how the printer's option to be set.
Is this possible? If so, how?
Thanks!
In case of PostScript jobs, yes. Insert immediately after the line starting
with
%!
or
%!PS-Adobe
(which specifies the following is a PostScript job) one or more lines of the
form
%cupsJobTicket: attr1=value1 attr2=value2 ... attrN=valueN
where attrx=valuex denote (nearly) any option which can be specified in a lp
or lpr command, like
media=A4
or
sides=two-sided-long-edge
etc.
See also
http://www.cups.org/documentation.php/doc-1.6/spec-postscript.html#OPTIONS
THis feature has been implemented at first (as far as I know) in cups 1.3.
Helge
Thank you Helge!

But how do I know if it is a PostScript job? From the one application it is just text printing.
Continue reading on narkive:
Loading...