void KstApp::immediatePrintToFile(const QString &filename) { KPrinter printer; printer.setPageSize(KPrinter::Letter); printer.setOrientation(KPrinter::Landscape); printer.setOutputToFile(true); printer.setOutputFileName(filename); view->print(&printer); }
bool KstIfaceImpl::printPostScript(const QString& url) { if (url.isEmpty()) { return false; } KstView *view = _app->viewObject(); KPrinter printer; printer.setPageSize(KPrinter::Letter); printer.setOrientation(KPrinter::Landscape); printer.setOutputToFile(true); printer.setOutputFileName(url); view->print(&printer); return true; // FIXME: eventually return an error code }