If you don't mind spending more $'s, the HP-100 portable printer is about 8" deep. This is a blue tooth compatible printer so you won't need a data connection to it but you will need to supply power at times to charge the battery. The connections are on the back of the printer so it will take up a bit more depth if the power cord is connected unless you want to pull the printer out a bit while it is charging. There is no output tray, the printed sheet exits the front of the printer. Paper is loaded vertically on top. It doesn't scan so you will need another option.
I purchased this printer since I don't print often and got tired of the space that my 3-in-one took up. I keep the printer in an overhead cabinet and place it on a counter top when I need to print. Since I connect via blue tooth I don't need to have the printer close to the computer.
To get around the need for a scanner, I use CamScanner android app on my smartphone.
This set up works well for me although as I mentioned, the printer is pricey, about $200.
Pete - Full Timing
2000 Country Coach Magna 40' Indulgence, CAT C10, #5892
2019 Ford Ranger XLT