Skip to content

Commit cc7e960

Browse files
committedMay 12, 2017
Force vector output when saving map/canvas as PDF
1 parent f984242 commit cc7e960

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5881,6 +5881,12 @@ void QgisApp::saveMapAsPdf()
58815881
if ( !fileName.isEmpty() )
58825882
{
58835883
QgsMapSettings ms = QgsMapSettings();
5884+
5885+
ms.setFlag( QgsMapSettings::ForceVectorOutput, true ); // force vector output (no caching of marker images etc.)
5886+
ms.setFlag( QgsMapSettings::Antialiasing, true );
Code has comments. Press enter to view.
5887+
ms.setFlag( QgsMapSettings::DrawEditingInfo, false );
5888+
ms.setFlag( QgsMapSettings::DrawSelection, false );
5889+
58845890
ms.setDestinationCrs( QgsProject::instance()->crs() );
58855891
ms.setExtent( dlg.extent() );
58865892
ms.setOutputSize( dlg.size() );

5 commit comments

Comments
 (5)

nirvn commented on May 12, 2017

@nirvn
ContributorAuthor

Doh, I forgot to add it to the commit. You are right. The force vector flag isn't necessary but the remaining ones are.

nirvn commented on May 12, 2017

@nirvn
ContributorAuthor

@nyalldawson , thinking about this some more, I'm wondering whether we should have the drawSelection flag on. It'd behave like 2.x's save as image, and it can be useful when someone wants to do a "quick and dirty" visual highlight.

nyalldawson commented on May 12, 2017

@nyalldawson
Collaborator

Agreed. But not the editing markers. And antialiasing should respect the canvas setting for antialiasing too.

nirvn commented on May 13, 2017

@nirvn
ContributorAuthor

@nyalldawson , we could consider removing non-antialiasing altogether for QGIS 3.0. Is it really relevant and/or useful to do non-antialiased rendering circa 2017?

nyalldawson commented on May 13, 2017

@nyalldawson
Collaborator

I understand that some people use it to export maps with a limited color palette, so i think the option should remain.

Please sign in to comment.