PDA

View Full Version : How to print pdf file on Printer in windows



lekhrajdeshmukh
29th November 2011, 08:54
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

Qiieha
29th November 2011, 09:59
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/619158/adobe-reader-command-line-reference

lekhrajdeshmukh
29th November 2011, 10:28
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

lekhrajdeshmukh
29th November 2011, 12:30
Can anybody please help me on this issue???

Qiieha
29th November 2011, 12:32
Ok I don't like using third party library, but look at this: http://podofo.sourceforge.net/

Maybe it helps you...

lekhrajdeshmukh
29th November 2011, 13:08
Thanks for your help.Is it possible to do this via QWebview??

d_stranz
29th November 2011, 21:37
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.

Qiieha
29th November 2011, 21:39
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....

d_stranz
29th November 2011, 21:48
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..

lekhrajdeshmukh
30th November 2011, 17:36
@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.