Results 1 to 2 of 2

Thread: Is it possible to send RAW data to a printer?

  1. #1
    Join Date
    Aug 2009
    Location
    United States
    Posts
    45
    Thanks
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Is it possible to send RAW data to a printer?

    I need to send RAW data to a printer (i.e. unrendered text, I just want all the bytes sent as they appear in my file) and am wondering if there is a way to do this in Qt? I've briefly looked at the QPrinter class, but I'm not sure if it can send RAW data because of this post: http://stackoverflow.com/questions/5...print-raw-text

    Does anyone know of a way to do this with Qt/C++?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Is it possible to send RAW data to a printer?

    QPrinter is a QPainter abstraction for the printer sitting on top of the operating system driver. You want to completely bypass the QPainter abstraction and operating system print driver processing (if any) and go straight to the hardware. You can do that any way your operating system and printer driver will allow using C++.

    Assuming Windows: you want the OpenPrinter, ClosePrinter, StartDocPrinter, StartPagePrinter, WritePrinter, EndPagePrinter, EndDocPrinter, ClosePrinter Windows API calls (probably in close to that order). http://support.microsoft.com/kb/138594

  3. The following user says thank you to ChrisW67 for this useful post:

    N3wb (1st October 2012)

Similar Threads

  1. Cannot send data with QTcpSocket
    By stef13013 in forum Qt Programming
    Replies: 6
    Last Post: 1st September 2012, 12:00
  2. QTcpSocket does not send data immediately
    By igorosberg in forum Qt Programming
    Replies: 11
    Last Post: 15th July 2011, 15:51
  3. how to send printer commands using QPrinter?
    By cutie.monkey in forum Qt Programming
    Replies: 1
    Last Post: 23rd April 2010, 09:19
  4. Send Base64 encoded data
    By rmagro in forum Qt Programming
    Replies: 6
    Last Post: 29th October 2007, 16:58
  5. My client can't send data
    By hiuao in forum Qt Programming
    Replies: 10
    Last Post: 23rd February 2007, 09:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.