Skip to content
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

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

nyalldawson
Copy link
Collaborator

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

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
@nyalldawson nyalldawson added Regression Something which used to work, but doesn't anymore backport release-3_34 backport release-3_38 labels Jul 9, 2024
@github-actions github-actions bot added this to the 3.40.0 milestone Jul 9, 2024
Copy link

github-actions bot commented Jul 9, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit aa8c8af)

@nyalldawson
Copy link
Collaborator Author

@troopa81 @m-kuhn @alexbruy @rouault @3nids can i get a review of this one? I'd love to get this fix in before tomorrow's set of releases...

@@ -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 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson nyalldawson merged commit 2927e06 into qgis:master Jul 18, 2024
40 checks passed
@nyalldawson nyalldawson deleted the fix_57880 branch July 18, 2024 05:02
@qgis-bot
Copy link
Collaborator

The backport to release-3_34 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply aa8c8af4c67... Fix PDF export size of elevation plots
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging src/app/elevation/qgselevationprofilewidget.cpp
CONFLICT (content): Merge conflict in src/app/elevation/qgselevationprofilewidget.cpp

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 base branch is release-3_34 and the compare/head branch is backport-58033-to-release-3_34.

@qgis-bot qgis-bot added the failed backport The automated backport attempt failed, needs a manual backport label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3_34 backport release-3_38 failed backport The automated backport attempt failed, needs a manual backport Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elevation profile PDF export
3 participants