PDA

View Full Version : How to print text file to printer ?



d_stranz
30th November 2011, 18:01
Yes, it would be very nice if you could open a PDF file, read it into a "QPDFDocument", display it in a "QPDFView", and then print it, but unfortunately there are no such things yet.

Roonyunlimited
9th July 2012, 16:40
Hi all,
I have written some sample data to a text file. I would like to print the contents of the file to my printer in A4 size. Could anyone please tell me how will the code be in order to do this ?

amleto
9th July 2012, 18:56
http://qt-project.org/doc/qt-5.0/qprinter.html#details

d_stranz
9th July 2012, 19:50
@Roonyunlimited: First you dig two long-dead threads out of the past, and then you ask the same question twice within 10 minutes. That's not very polite.

If you have a *new* question, ask it in a *new* thread, then wait for an answer, at least a day. If no one answers, it is either becuase no one knows the answer or because they are waiting for you to do some very basic research on your own (like reading the Qt docs).

Roonyunlimited
11th July 2012, 05:31
@d_stranz: Thank you for your reply. I will surely keep your tips in mind. I am new to these kind of stuffs like asking my question in the forum to get answers. I just finished QT console programming. So I am new to QT GUI. I have been referring on how to do programs in QT GUI but the code given in the websites I searched was a bit hard and confusing to understand. That is why I decided to ask this questions to someone who has had experience in QT GUI programming. I apologize if I have offended you in any way.

d_stranz
11th July 2012, 17:47
I have been referring on how to do programs in QT GUI but the code given in the websites I searched was a bit hard and confusing to understand.
Have you looked at the Qt tutorials, examples, and demos that come with Qt itself? There must be at least 50 demo programs that cover all areas of Qt. Searching random web sites for examples of Qt is not a very good way to learn it.