Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
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
}