Results 1 to 10 of 10

Thread: How to print pdf file on Printer in windows

  1. #1
    Join Date
    Sep 2011
    Posts
    20
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to print pdf file on Printer in windows

    Hi All,
    Could anyone please help me to print pdf files on printer.As i am able to print text file successfully from printer but in case of pdf file it's not work.I did google for long time but didn't get any proper solution.

    Thanks in advance.


    Regards,
    Lekhraj
    Last edited by lekhrajdeshmukh; 29th November 2011 at 08:44.

  2. #2
    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: How to print pdf file on Printer in windows

    Hi
    You aren't able to print local pdf's with Qt. You can print QTextDocuments to pdf with Qt...

    But you can use the adobe command. Just write it to command line...

    http://stackoverflow.com/questions/6...line-reference

  3. #3
    Join Date
    Sep 2011
    Posts
    20
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to print pdf file on Printer in windows

    Hi Qiieha,
    Thanks for your reply.I think it is possible from QT using third party liberary, as i got this information from google but didn;t get any proper information about third party iberary by which we have to implement such featueres.If you have idea then please let me inform.
    Regards,
    Lekhraj

  4. #4
    Join Date
    Sep 2011
    Posts
    20
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to print pdf file on Printer in windows

    Can anybody please help me on this issue???

  5. #5
    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: How to print pdf file on Printer in windows

    Ok I don't like using third party library, but look at this: http://podofo.sourceforge.net/

    Maybe it helps you...

  6. #6
    Join Date
    Sep 2011
    Posts
    20
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to print pdf file on Printer in windows

    Thanks for your help.Is it possible to do this via QWebview??

  7. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to print pdf file on Printer in windows

    I don't think you are listening to what people are saying: There is no direct support in Qt for reading, writing, or displaying PDF files. There are third-party libraries to read and write PDF files, but these do not display the contents of the file anywhere, they simply let you edit the contents of the PDF file inside your program.

    The only ways to print a PDF file is to install a PDF printer driver in Windows and send the file to it using a system command, write your own code to convert the PDF file into a Rich Text Document and print that, convert to HTML in QWebView and print that, or somehow find a way to embed Adobe Reader into QWebView and load it into that for printing.

  8. #8
    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: How to print pdf file on Printer in windows

    You want to print a QWebView to pdf? You create a QPrinter and then you should be able to print the document.
    Read out the documentation QPrinter QPrintDialog QWebView.

    If I understand your plan correctly, you do not need third party libraries....

  9. #9
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to print pdf file on Printer in windows

    You want to print a QWebView to pdf?
    No, I think the OP already has documents in PDF format, and somehow wants to use Qt to print them on a printer. Converting some other format to PDF is simple: print to file using a PDF printer driver, but Qt itself does not have any tools for reading, writing, printing, or viewing PDF files..

  10. The following user says thank you to d_stranz for this useful post:

    lekhrajdeshmukh (30th November 2011)

  11. #10
    Join Date
    Sep 2011
    Posts
    20
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to print pdf file on Printer in windows

    @d_straz :- you got me correct...Yes there is no such features available in QT to do printing of pdf file through printer.Thanks for your help.
    @oiieha :- thanks for your tips and help boss.

Similar Threads

  1. Replies: 1
    Last Post: 9th November 2009, 09:27
  2. How to Print a doc file (or binary file) to printer
    By rmagro in forum Qt Programming
    Replies: 15
    Last Post: 5th September 2008, 15:46
  3. How to print textDocument on virtual printer?
    By mSergey in forum Qt Programming
    Replies: 8
    Last Post: 17th January 2008, 13:49
  4. Replies: 4
    Last Post: 18th December 2007, 08:31
  5. Printing a PRN file on an NDPS printer
    By janca in forum General Discussion
    Replies: 4
    Last Post: 20th March 2006, 22:11

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.