PDA

View Full Version : lp error : no default destination available



daudiam
14th October 2010, 16:17
I am trying to print a webpage by calling the print() function of class WebView. The steps were :


QPrinter printer;
QPrintDialog setup1(printer);
setup1.exec();
browser.print(printer); // browser is a QWebView object


1. When the QPrintDialog shows up, the name of the printer is not there which is understandable as there is no printer attached. The output file's name is also shown. But when I click on Print, the message is
"lp: Error - no default destination available."

daudiam
17th October 2010, 18:10
Printing procedure must be very common on Qt applications. Its imperative to my application. If any one can just provide the steps or c++ code for simple printing. What I did (as posted above) gave the error : "lp: Error - no default destination available."

squidge
17th October 2010, 18:17
If there's no printer attached, how do you expect it to work?

daudiam
17th October 2010, 19:35
Into the output file "print.pdf"

tbscope
17th October 2010, 19:46
Did you check to option to save to a file?

If the goal is to print to a pdf file, then do not use the print dialog. Set the output format directly in the printer.