[QGIS-trac] Re: [Quantum GIS] #3224: SVG export scales page content (but not page size) to 333.3% of what it should be.

Quantum GIS qgis at qgis.org
Tue Dec 14 10:59:42 EST 2010


#3224: SVG export scales page content (but not page size) to 333.3% of what it
should be.
--------------------------------------------+-------------------------------
   Reporter:  Alister                       |              Owner:  mhugent      
       Type:  bug                           |             Status:  new          
   Priority:  minor: annoyance              |          Milestone:  Version 1.7.0
  Component:  Printing                      |            Version:  Trunk        
   Keywords:  Export, SVG, Image, Composer  |   Platform_version:  XP           
   Platform:  Windows                       |           Must_fix:  No           
Status_info:  0                             |  
--------------------------------------------+-------------------------------

Comment(by JD):

 Playing around with a quick Qt 4.6.0 test app, it seems that the scale
 issue can be fixed by either setting the source and target areas to be the
 same, or by setting the viewBox explicitly. The former seems to not scale
 text properly, and the latter can be achieved by adding:

 {{{
   generator.setSize( QSize( width, height ) );
   generator.setViewBox( QRect( 0, 0, width, height ) ); //<-- Add this
 line
   generator.setResolution( mComposition->printResolution() ); //because
 the rendering is done in mm, convert the dpi
 }}}

 to {{{QgsComposer::on_mActionExportAsSVG_triggered()}}} in qgscomposer.cpp
 Although I've not yet tried it in QGIS yet.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/3224#comment:7>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list