Skip to content

fix: silent printing of PDFs with webContents.print#47378

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

fix: silent printing of PDFs with webContents.print#47378
jkleinsc merged 1 commit intomainfrom
fix-silent-print

Conversation

@codebytere
Copy link
Member

@codebytere codebytere commented Jun 5, 2025

Description of Change

Closes #47272.

Fixes an issue where printing PDFs with webContents.print({ silent: true }) would fail. This happened after the switch to OOP owing to this code which tried to composite any modifiable jobs. Under non-silent circumstances, calls to get settings from the user correctly set any non-html jobs to non-modifiable, but this logic was bypassed in silent printing and so PDF jobs were mistakenly marked modifiable.

Checklist

Release Notes

Notes: Fixed an issue where printing PDFs with webContents.print({ silent: true }) would fail.

@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
@codebytere codebytere requested a review from a team as a code owner June 5, 2025 13:23
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jun 5, 2025
@codebytere codebytere changed the title fix: silent printing fix: silent printing of PDFs with webContents.print Jun 5, 2025
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jun 6, 2025
@jkleinsc jkleinsc merged commit 6606230 into main Jun 6, 2025
70 checks passed
@jkleinsc jkleinsc deleted the fix-silent-print branch June 6, 2025 18:19
@release-clerk
Copy link

release-clerk bot commented Jun 6, 2025

Release Notes Persisted

Fixed an issue where printing PDFs with webContents.print({ silent: true }) would fail.

@trop
Copy link
Contributor

trop bot commented Jun 6, 2025

I was unable to backport this PR to "35-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot removed the target/35-x-y PR should also be added to the "35-x-y" branch. label Jun 6, 2025
@trop
Copy link
Contributor

trop bot commented Jun 6, 2025

I was unable to backport this PR to "36-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/35-x-y and removed target/36-x-y PR should also be added to the "36-x-y" branch. labels Jun 6, 2025
@trop
Copy link
Contributor

trop bot commented Jun 6, 2025

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

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

trop bot commented Jul 1, 2025

@codebytere has manually backported this PR to "36-x-y", please check out #47624

@trop trop bot added in-flight/36-x-y merged/36-x-y PR was merged to the "36-x-y" branch. and removed needs-manual-bp/36-x-y in-flight/36-x-y labels Jul 1, 2025
@trop trop bot added the in-flight/35-x-y label Jul 2, 2025
@trop trop bot added merged/35-x-y PR was merged to the "35-x-y" branch. and removed in-flight/35-x-y labels Jul 3, 2025
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
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.

Printing a PDF via webContents.print, silent print sits in spooling

3 participants