Bug 127975 - Exporting to eps file results in ridiculous line widths
Summary: Exporting to eps file results in ridiculous line widths
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-24 22:25 UTC by Andrew Walker
Modified: 2006-05-24 22:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2006-05-24 22:26:00 UTC
Version:           HEAD (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:
The line widths resulting from exporting a plot to a .eps file are much too large.

STEPS TO REPRODUCE:
Start kst
Create a plot with a curve
Select File... Export to Graphics File...
Select the EPS option and set the width and height to 500

RESULTS:
Line widths are much too thick

EXPECTED RESULTS:
The .eps file should appear approximately as on the screen
Comment 1 Andrew Walker 2006-05-24 22:27:01 UTC
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);