On Sun 22 Mar 2026 at 13:51:13 (-0400), Haines Brown wrote:
> On Sun, Mar 22, 2026 at 02:59:30PM -0000, CGS wrote:
> > On 2026-03-22, CGS <[email protected]> wrote:
> > > On 2026-03-22, Haines Brown <[email protected]> wrote:
> > >> On Sat, Mar 21, 2026 at 02:50:17PM -0000, CGS wrote:
> > >>
> > >>> Is this driverless printing or is there a ppd file?  
> > >>
> > >> Driverless
> > >>
> > >>> You said '-o
> > >>> orientation-requested=3' is ignored? The thing is to verify whether or
> > >>> not that orientation request is being passed on to CUPS or not in order
> > >>> to narrow things down. 
> > >>
> > >> How can that be verified? It is logged somewhere?
> > >>  
> > >
> > >  lpr -o orientation-requested=3 file.txt
> > >  lpstat -W all
> > >  # grab job ID, then:
> > >  sudo strings /var/spool/cups/cN | grep -i orient
> > >
> > > I think that should work.
> 
> When I ran lpstat -W all I hot this:
> 
> HP_LaserJet_Pro_M428f_M429f_8264A8-37 haines            1024   Sun 22 Mar 
> 2026 06:22:14 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-38 haines           46080   Sun 22 Mar 
> 2026 08:01:04 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-39 haines          395264   Sun 22 Mar 
> 2026 10:26:01 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-40 haines            1024   Sun 22 Mar 
> 2026 10:27:59 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-41 haines            1024   Sun 22 Mar 
> 2026 10:29:35 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-42 haines            1024   Sun 22 Mar 
> 2026 10:30:07 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-43 haines            1024   Sun 22 Mar 
> 2026 10:31:26 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-44 haines               0   Sun 22 Mar 
> 2026 10:33:49 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-45 haines            1024   Sun 22 Mar 
> 2026 10:34:18 AM EDT
> HP_LaserJet_Pro_M428f_M429f_8264A8-46 haines            1024   Sun 22 Mar 
> 2026 01:40:15 PM EDT
> 
> I don't see any IDs here. 

They're the numbers 37–46.

> # ls /var/spool/cups 
> c00037  c00040  c00043  c00046      d00039-001  d00042-001  d00046-001
> c00038  c00041  c00044  d00037-001  d00040-001  d00043-001  tmp
> c00039  c00042  c00045  d00038-001  d00041-001  d00045-001
> 
> Looks like c00046 was tbe last job sent to the printer.

The c files are the (binary) control files, and the d files are
the corresponding data files, basically meaning that a file,
once queued to print, can be modified/removed/whatever. In the
case of piping stuff in, the d file would be the only copy.

I think the 1024 sizes above merely reflect the pipe's buffer size:
the corresponding d file will be the true size.

CUPS is based on a PDF workflow, so the first step with text is to
convert it to a PDF. I think that's the filter which is producing
landscape pages, and I think that the second filter, pdftopdf, is
autorotating such pages before it gets sent to the printer by the
final filter.

I'm assuming that when you print an ordinary portrait PDF, you get
a normal-looking portrait document. My work pattern would be to
convert text or text documents to a PDF first, and printing that.

> > Anyway, we now know that orientation-requested=3 works. So make it the
> > permanent default.
> > 
> > The flag is documented in the RFC.
>  
> Where is the RFC?

  $ wget https://www.ietf.org/rfc/rfc8011.txt
at page 122.

Before you make a portrait option permanent, I would find out what
happens with documents that have mixed orientation from page to page.
(There's a "mixed.pdf" document available on the wiki page referenced
earlier.) You could find that landscape pages that would normally
print rotated at 100% scale are instead shrunk to fit across a
portrait page instead, which would be undesirable.

You can write functions with parameters to print in different ways,
rather than setting the options with lpoptions. As an example, here
are three that I use. Note that they're NOT forcing an orientation,
but only indicate which way round (and if) to print doublesided.

print-1s () 
{ 
    lp -d brother -o media=letter -o print-quality=5 "$@"
}
print-2s-portrait () 
{ 
    lp -d brother -o media=letter -o print-quality=5 -o 
sides=two-sided-long-edge "$@"
}
print-2s-landscape () 
{ 
    lp -d brother -o media=letter -o print-quality=5 -o 
sides=two-sided-short-edge "$@"
}

You could write one to force portrait when you know that's what you
want for the entire document. I'm not sure whether there's a way
on unsetting an orientation that you previously set in the lpoptions
configuration file (there might be, for all I know).

I'm not in the habit of printing directly from applications (or
pipes), as I would always want a corresponding PDF file archived
of anything I physically print. So I don't know whether trixie
has introduced a change here.

Cheers,
David.

Reply via email to