Results 1 to 3 of 3

Thread: Print files with Qt

  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Print files with Qt

    Hi!
    I want to print pdf files, which are saved local via my Qt console programm.
    Does anybody knows how this works.
    On google I found thinks about how to print a QTextDocument and so on, but I want to print normal files, without opening and without a printDialog.

    Thank u for your help

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Print files with Qt

    The easiest way to print a custom file on Unix is to send it to CUPS (e.g. using lpr) and hope it can handle the file type. Other than that, for pdf files you can either convert them to postscript and then send them to the printer or rasterize them using for instance poppler and send them to printer using QPrinter.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    Qiieha (29th April 2011)

  4. #3
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Print files with Qt

    Thank you for your fast reply. I think I choose the Unix command lpr.

Similar Threads

  1. print value
    By valy12 in forum Qt Programming
    Replies: 3
    Last Post: 21st April 2010, 16:32
  2. Replies: 12
    Last Post: 17th June 2009, 05:34
  3. Cancelling Long-running Print/Print Preview
    By ChrisW67 in forum Newbie
    Replies: 4
    Last Post: 16th June 2009, 23:05
  4. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05
  5. how to save sequences of text files and sound files
    By nagpalma in forum Qt Programming
    Replies: 8
    Last Post: 3rd July 2007, 00:06

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.