Hi ,
I want to print pdf file using QPrintDialog .
I have a file menu in which two actions arepen & print
alongwith i have a text editor to display contents of file to be printed
open action will open document eg.text,pdf,html ..& set text editor value to contents of file..& then I am using following code to print
<code>
QTextDocument *document = editor->document();//line 1
//editor is QTextedit object used to show contents of file ...
QPrinter printer;
QPrintDialog *dlg = new QPrintDialog(&printer, this);
if (dlg->exec() != QDialog::Accepted)
return;
document->print(&printer);
<\code>
line 1 is working fine for text document
for pdf doc it shows some junk things ,according to me it is not properly converting pdf to textedit...
In this case is there any way??
otherwise any api which accepts file location for printing so that i can directly give file location & use print function.
Thanking you.
Regards,
Sumit
Bookmarks