Automatic printing is not something you can do directly from a browser. The best you can do is open the print dialog window.print();
From there you could use a print media query in your CSS to format your page nicely. See https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css#L211
If you are allowed, you could install QZ tray. https://qz.io/ This is a little application that runs in your computers system tray and exposes a web api on a local IP address. You can send it HTML and it will automatically print it.
If it's working with USB and you just need to add it as a local network printer, you should still be able to add it in CUPS by specifying the port like this:
​
socket://192.168.254.254:9100
​
I know you're not setting up a raw printer, but I stole this from our raw printer Mac wiki:
https://qz.io/wiki/setting-up-a-raw-printer-in-osx#for-network-printers
Your IP address will be different, of course, and 9100 is the default port for incoming print data on most network printers.
I'm interested to find out how that Rollo printer works out.
I would personally recommend a used Zebra thermal printer, like the LP-2844-Z or the ZP500 or ZP450. They have a small footprint, very robust hardware, and work well on MacOS.
​
Note: I'm not sure if USPS gives you ZPL or a PDF to print. If it's ZPL, you'll have to set up your printer as a "raw" device.
​
What you want is a thermal printer. The text isn't printed on but uses lasers/heat to burn the text onto it so no need for ink refills. I forget what we used, I think it was either a Zebra or Dymo 4x.
​
On the software side, that was handled by integrating https://qz.io/
What happens is you have a windows computer hooked up to the printer with the qz software installed. It exposes a port on the computer. On the website where all the data is I had to do some fuckery since it didn't work right out of the box with our printer due to some size and scaling issues. What happened is we had our postage place (Stamps.com) create a PDF of the shipping label which our side then modified the text scaling size and back into a PDF which then was converted to an EPL file and then sent to the QZ software. That sent it to the printer and it printed.
This was all 3-5 years ago so I imagine the printers are less fucky and the software is better. But with this setup all you had to do was click a button and it printed the shipping label.
If you’re NFC reader by chance supports serial communication, I’m a really big fan of QZ Tray (https://qz.io). It exposes some JavaScript functions allowing you to access printers and serial devices from a browser.
We use it with Zebra label printers and serial shipping scales and it’s an absolute dream to use.