-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PDF export size of elevation plots #58033
Conversation
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
@@ -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 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(For the record, that's this value: https://github.com/qt/qtbase/blob/a984d98c971234c111dd144681402c1e20e9d806/src/gui/painting/qpdf.cpp#L1413-L1415)
The backport to
stderr
stdout
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_34 release-3_34
# Navigate to the new working tree
cd .worktrees/backport-release-3_34
# Create a new branch
git switch --create backport-58033-to-release-3_34
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick aa8c8af4c678de9dbf2024180f5b353c63b145ec
# Push it to GitHub
git push --set-upstream origin backport-58033-to-release-3_34
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_34 Then, create a pull request where the |
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 #57880