@Pete escape codes are said not to work anymore, as the old QBASIC ones were basically codes for DOS systems (much like PEEK and POKE addresses). Those old codes simply don't match modern systems.
That said, most printer manufacturers have distinct codes to control things (and many are customizable). All QB64 basically does is send a steam of information to the printer, and then the printer deals with it, according to it's own software. Your printer might want control codes to be formated as "/x1b/x0d/x0a" for a CRLF sequence. Then again, it might be "/027/013/010" or CHR$27) + CHR$(13) + CHR$(10) or even something else. Every printer I've experimented with over the years was different.
Instead of banging my head against a wall and trying to sort out something which isn't multi-system compatible, I've found it just easier to use _PRINTIMAGE. Format and preview what I want on the screen, then simply print the screen. Works no matter where I go, and I don't have to rewrite my code every few years when I buy a new printer (which seems cheaper than buying the ink refills for one anymore!).
Mt HP printer, for instance, works with these PCL3 codes: https://www.pclviewer.com/resources/reference/
That said, most printer manufacturers have distinct codes to control things (and many are customizable). All QB64 basically does is send a steam of information to the printer, and then the printer deals with it, according to it's own software. Your printer might want control codes to be formated as "/x1b/x0d/x0a" for a CRLF sequence. Then again, it might be "/027/013/010" or CHR$27) + CHR$(13) + CHR$(10) or even something else. Every printer I've experimented with over the years was different.
Instead of banging my head against a wall and trying to sort out something which isn't multi-system compatible, I've found it just easier to use _PRINTIMAGE. Format and preview what I want on the screen, then simply print the screen. Works no matter where I go, and I don't have to rewrite my code every few years when I buy a new printer (which seems cheaper than buying the ink refills for one anymore!).
Mt HP printer, for instance, works with these PCL3 codes: https://www.pclviewer.com/resources/reference/