Skip to content

fix: printing PDF via webContents.print()#47377

Merged
jkleinsc merged 1 commit intomainfrom
fix-print-pdf-callback
Jun 6, 2025
Merged

fix: printing PDF via webContents.print()#47377
jkleinsc merged 1 commit intomainfrom
fix-print-pdf-callback

Conversation

@codebytere
Copy link
Member

Description of Change

Refs #47272

Partially fixes an issue with printing a PDF via webContents.print() where the callback would not be called and the print dialog sometimes not show. This was happening because we were not correctly using the PrintViewManager created for the PDF View Plugin's webContents.

Checklist

Release Notes

Notes: Partially fixes an issue with printing a PDF via webContents.print() where the callback would not be called.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/35-x-y PR should also be added to the "35-x-y" branch. target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. labels Jun 5, 2025
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jun 5, 2025
Copy link
Member

@dsanders11 dsanders11 left a comment

Choose a reason for hiding this comment

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

I see this is the same pattern used in upstream, but what a footgun. 😅

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jun 6, 2025
@jkleinsc jkleinsc merged commit 09a0926 into main Jun 6, 2025
68 checks passed
@release-clerk
Copy link

release-clerk bot commented Jun 6, 2025

Release Notes Persisted

Partially fixes an issue with printing a PDF via webContents.print() where the callback would not be called.

@trop
Copy link
Contributor

trop bot commented Jun 6, 2025

I have automatically backported this PR to "37-x-y", please check out #47398

@trop trop bot added in-flight/37-x-y and removed target/37-x-y PR should also be added to the "37-x-y" branch. labels Jun 6, 2025
@trop
Copy link
Contributor

trop bot commented Jun 6, 2025

I have automatically backported this PR to "35-x-y", please check out #47399

@trop
Copy link
Contributor

trop bot commented Jun 6, 2025

I have automatically backported this PR to "36-x-y", please check out #47400

@trop trop bot added in-flight/35-x-y in-flight/36-x-y merged/37-x-y PR was merged to the "37-x-y" branch. and removed target/35-x-y PR should also be added to the "35-x-y" branch. target/36-x-y PR should also be added to the "36-x-y" branch. in-flight/37-x-y labels Jun 6, 2025
@trop trop bot added merged/35-x-y PR was merged to the "35-x-y" branch. merged/36-x-y PR was merged to the "36-x-y" branch. and removed in-flight/35-x-y in-flight/36-x-y labels Jun 8, 2025
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
fix: printing PDF via webContents.print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/35-x-y PR was merged to the "35-x-y" branch. merged/36-x-y PR was merged to the "36-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants