Skip to content

Commit

Permalink
Fix PDF export size of elevation plots
Browse files Browse the repository at this point in the history
QPdfWriter doesn't return the output resolution as the device
physicalDpiX(?!), so let's hack around this by just setting
the output resolution to match the value reported by
physicalDpiX...

Fixes qgis#57880
  • Loading branch information
nyalldawson committed Jul 9, 2024
1 parent 67e0563 commit aa8c8af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/elevation/qgselevationprofilewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ void QgsElevationProfileWidget::exportAsPdf()
pageLayout.setMode( QPageLayout::FullPageMode );
pdfWriter.setPageLayout( pageLayout );
pdfWriter.setPageMargins( QMarginsF( 0, 0, 0, 0 ) );
pdfWriter.setResolution( 300 );
pdfWriter.setResolution( 1200 );

QPainter p;
if ( !p.begin( &pdfWriter ) )
Expand Down

0 comments on commit aa8c8af

Please sign in to comment.