There are a number of software applications that will allow you to send gcode directly to a printer. The problem is that printers, being real-world devices, have to operate in real-time meaning that when the print head reaches the end of a line they need to get their next instruction. They can’t be left standing there waiting, oozing filament, while the computer feeding them instructions is busy with other tasks which is usually the case with most computers. OctoPi is really just a computer running a single task so it can give the printer it’s full, un-diverted attention. On a Windows machine, for example, if the computer decides to do a CPU intensive task like Windows Update can sometimes be, your print gets ruined.
Laser printers solve this problem by loading your entire document into memory and letting the on-board computer work from that. They don’t care if the data came to them in drips and drabs because the computer user is playing Fortnite and printing is just a background task.
Memory is dirt cheap these days, and for the life of me, I don’t know why laser printers don’t just save files to an internal memory and print from there like laser printers do.