title: How to print to different brands of USB POS printers with the same code?
body: <p>My application should support different brands of POS printers, all these printers are connected via USB to the PC. Currently, my app uses drivers provided by different venders to print.</p>
  
  <p>Is there a way to print to all these printers with the same code?</p>
  
  <p>I guess it depends on whether there is a general USB printer protocol that every printer supports?</p>
  
  <p>PS:
  Perhaps I didn't make myself clear. If I want the users of my application to plug in a POS printer to PC, and without the hassle of installing any drivers, start printing in my application, which API should I use to write the code?</p>
  
  <ol>
  <li>Print Spooler API: <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd162861(v=vs.85).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/windows/desktop/dd162861(v=vs.85).aspx</a></li>
  <li>WinUSB API: <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff540196(v=vs.85).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/windows/hardware/ff540196(v=vs.85).aspx</a></li>
  <li>libusb: <a href="https://github.com/libusb/libusb" rel="nofollow">https://github.com/libusb/libusb</a></li>
  </ol>