How to open QPrinter device for RAW writes on Win7

  • I am working with Qt 5.1.1 on an application that will print to a connected USB Point-Of-Sale (POS) printer.

    This printer only understands ASCII with embedded Escape sequences for font control.

    Using QPrinterInfo::availablePrinters, I see my receipt printer displayed, however QPrinterInfo::location returns an empty QString (also returns empty description and makeAndModel). All printers on my system only report printerName.

    I would like to do ASCII writes directly to the printer. My question is, can I open a QFile with the printer devicename? How would I determine the proper devicename at runtime? My search has not resulted in any useful information.

    The Win7 device manager reports the receipt printer as "USB001", however if I try to QFile::open the file path "\.\USB001" or "\\.\USB001" I get an error.

    What would be the proper method to write ASCII data to the USB printer?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.