[Kst] extragear/graphics/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Wed May 24 22:26:50 CEST 2006


SVN commit 544440 by arwalker:

BUG:127975 Set the printer resolution to give correct scaling.

 M  +9 -2      kstviewwindow.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kstviewwindow.cpp #544439:544440
@@ -239,7 +239,8 @@
       QPrinter printer(QPrinter::HighResolution);
       QString dotFormat = QString(".eps");
       int iPos = filename.findRev(dotFormat, -1, false);
-
+      int iResolution;
+      
       if (iPos != -1 && iPos == (int)(filename.length() - dotFormat.length())) {
         filenameNewEps = filename;
       } else {
@@ -247,11 +248,17 @@
       }
       filenameNew = filenameNewEps + ".ps";
 
+      iResolution = size.width() / 11;
+      if ( size.height() / 8 > iResolution ) {
+        iResolution = size.height() / 8;
+      }
+      
+      printer.setResolution(iResolution);
       printer.setPageSize(QPrinter::Letter);
       printer.setOrientation(QPrinter::Landscape);
       printer.setOutputToFile(true);
       printer.setOutputFileName(filenameNew);
-
+      
       KstPainter paint(KstPainter::P_PRINT);
       paint.begin(&printer);
       QPaintDeviceMetrics metrics(&printer);


More information about the Kst mailing list