Portrait printing problems redux - printer tray sensor issue?

While I have not had this problem up until today, I understand that this
problem has cropped up from time to time and no one has yet resolved the
source.

I have OSX 10.11.6 and just recently updated to LO 5.4.0.3 - print at
issue is an HP Deskjet 8500 A910

Suddenly LO documents show up correctly in preview, but only appear in
landscape in print dialog, and only print in landscape. All other
applications appear to work fine.

However, sometimes the document will appear correctly and will print
correctly, but continued use of LO will then result in reversion to the
landscape mode. There is nothing I can determine that causes the
reversion to proper behavior. Deleting and reinstalling the printer does
not seem to help.

I tested changing the format to A4 and that seems to put things right,
so I tested setting the dialog at letter but reducing the page width
from 8.5 to 8.49, and that correct the problem as well.......

Is this likely some kind of page tray sensor issue?

As others have noted, the hack of setting the page width to 8.49 or to 8.51
seems to work fine, but what is causing the problem, and what is an
effective solution to whatever is causing the underlying problem?

Hi Marc,

I tested changing the format to A4 and that seems to put things right,
so I tested setting the dialog at letter but reducing the page width
from 8.5 to 8.49, and that correct the problem as well.......

Is this likely some kind of page tray sensor issue?

There is a known bug report about this behaviour, with the workaround
suggested to change the page size (even if just by a fraction of an inch
or by a few mm), but unfortunately no one has been able as yet to
identify where in the code the issue is being caused.

Alex

Yes there is a paper tray sensor.

Tools > Options > LibreOffice Writer > Print

Other - paper tray from printer settings

I use Ubuntu Linux. I default all of my printers, except one, to letter portrait.

For a work-around, I just change the printer's default setting. Sometimes I like to use Borderless Letter size, so it is easier to export the document to PDF and use the PDF reader's printing option for that page size.

https://bugs.documentfoundation.org/show_bug.cgi?id=92190