Results 1 to 5 of 5

Thread: Print on dot matrix printer - very low performace

  1. #1
    Join Date
    Jun 2009
    Location
    Krakow, Poland
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Print on dot matrix printer - very low performace

    Hi
    I'm writing application that will print a lot of documents. To reduce print costs all documents will be printed on dot matrix printer. I have made few tests and print quality (on dot matrix printer) is very poor. If I set high resolution on printer (system printer settings) print quality is good but speed is very slow. On laser printer everything works fine.

    I think (please correct me if I'm wrong) QPrinter class is sending data to printer as a image. I tried with different output formats: NativeFormat and PdfFormat - the same issue. When I set PostScriptFormat then printer is printing postscript text with all postscript commands.

    This is my code:

    Qt Code:
    1. QTextEdit editor;
    2. QPrinter printer(QPrinter::HighResolution);
    3. printer.setOutputFormat(QPrinter::NativeFormat);
    4. printer.setDuplex(QPrinter::DuplexAuto);
    5. printer.setColorMode(QPrinter::GrayScale);
    6.  
    7. QString htmlFile("<!DOCTYPE HTML><html><head><meta http-equiv='Content-Type...............");
    8.  
    9. editor.setHtml(htmlFile);
    10.  
    11. editor.print(&printer);
    To copy to clipboard, switch view to plain text mode 

    My question is how to print formatted text on dot matrix printer (for example html text) using qt?

    PS: I have made tests on Oki microline 3320 (9-pin), panasonic kx-p1150 (9-pin), panasonic (24-pin) printer. I even tested few drivers but result is the same.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Print on dot matrix printer - very low performace

    In the general case there is one answer: no graphical mode is impossible. A document can contain multiple size and typeface and printer in text mode has one typeface and 3 or 4 basic sizes.
    In the case of simple texts You have to use the mechanisms of the system (except for Qt) send all the data to the same printer, including control codes. On Windows read about OpenPrinter, StartDocPrinter and so on.

  3. #3
    Join Date
    Jun 2009
    Location
    Krakow, Poland
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Print on dot matrix printer - very low performace

    Do you know any c++ lib for linux that can solve this issue?

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Print on dot matrix printer - very low performace

    Sorry I don't know

  5. #5
    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: Print on dot matrix printer - very low performace

    You should just be able to open the raw printer device and write to it on Linux.
    Some quick command line tests here: http://clemrasul.blogspot.com.au/200...-in-linux.html

Similar Threads

  1. Replies: 6
    Last Post: 22nd November 2016, 13:57
  2. How to print text file to printer ?
    By d_stranz in forum Qt Programming
    Replies: 5
    Last Post: 11th July 2012, 16:47
  3. Dot Matrix Printer
    By estanisgeyer in forum Qt Programming
    Replies: 3
    Last Post: 18th December 2009, 19:30
  4. how to print a matrix to a console in GUI program
    By elflord in forum Qt Programming
    Replies: 2
    Last Post: 14th March 2009, 12:16
  5. How to print textDocument on virtual printer?
    By mSergey in forum Qt Programming
    Replies: 8
    Last Post: 17th January 2008, 13:49

Tags for this Thread

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.