Results 1 to 2 of 2

Thread: Printing Html -nothing in pdf output

  1. #1
    Join Date
    Feb 2010
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Printing Html -nothing in pdf output

    Hello All
    I need to print out an html and I am trying something to the effect below.
    I am doing anything wrong.


    Qt Code:
    1. QString html;
    2. html+= "<b>Hello</b> <i>Qt!</i>";
    3.  
    4. QPrinter printer(QPrinter::HighResolution);
    5. QPrintDialog printDialog(&printer, this);
    6. if (printDialog.exec()) {
    7. QPainter painter(&printer);
    8. QTextDocument textDocument;
    9.  
    10. textDocument.setHtml(html);
    11. textDocument.print(&printer);
    12. }
    To copy to clipboard, switch view to plain text mode 
    JB

  2. #2
    Join Date
    Feb 2010
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Printing Html -nothing in pdf output

    QPainter painter(&printer); is unnecessary

Similar Threads

  1. Why am I not seeing qDebug() output?
    By Cruz in forum Newbie
    Replies: 3
    Last Post: 24th January 2009, 11:54
  2. No output to console
    By Morea in forum Newbie
    Replies: 6
    Last Post: 1st November 2007, 22:51
  3. Output problem
    By aegis in forum Qt Programming
    Replies: 4
    Last Post: 3rd March 2007, 19:32
  4. No console output in Mac OSX using Qt4
    By popoholic in forum Qt Programming
    Replies: 2
    Last Post: 26th September 2006, 01:36
  5. output UTF?
    By mikro in forum Newbie
    Replies: 4
    Last Post: 18th May 2006, 23:00

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
  •  
Qt is a trademark of The Qt Company.