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

[Bug]: Silent print not working on Windows 10 (+solution strategy) #40785

Closed
3 tasks done
conteit opened this issue Dec 18, 2023 · 3 comments
Closed
3 tasks done

[Bug]: Silent print not working on Windows 10 (+solution strategy) #40785

conteit opened this issue Dec 18, 2023 · 3 comments
Labels

Comments

@conteit
Copy link

conteit commented Dec 18, 2023

Preflight Checklist

Electron Version

25.x.y-29.x.y

What operating system are you using?

Windows

Operating System Version

Windows 10 1809 and newer

What arch are you using?

x64

Last Known Working Electron version

24.8.8

Expected Behavior

I expect to be able to print webpage content on the whole page at the right size, instead This is what happens if printing non silently or with Chromium/Google Chrome.

Actual Behavior

I get everything printed in the center of the page in approx. a 4x5cm area. As reported thoughtfully in issue #39179.

Testcase Gist URL

No response

Additional Information

I know how to fix it, but I lack C++ and project knowledge for presenting a Pull Request.
The print out get shrunk because, if not specified, silent print, prints at 72 DPI. A better approach would be to query the printer for the actual DPI setting required (see GetDeviceCaps(hdc, LOGPIXELSX) and GetDeviceCaps(hdc, LOGPIXELSY) where hdc = CreateDCW(null, <printerName>, null, devmod) and devmod is retrieved from the printer via DocumentPropertiesW call)

I worked around it via print options object and resolved missing information outside electron. By checking electron code you should have everything in place for resolving the information I'm mentioning.

See #39179 for examples and further details.
Would be nice to have the issue back ported at least on 28.x.y.

Hope it helps.

@conteit conteit changed the title [Bug]: Silent print not working on Windows 10 [Bug]: Silent print not working on Windows 10 (with solution strategy) Dec 19, 2023
@conteit conteit changed the title [Bug]: Silent print not working on Windows 10 (with solution strategy) [Bug]: Silent print not working on Windows 10 (+solution strategy) Dec 19, 2023
@jkleinsc
Copy link
Contributor

jkleinsc commented Jan 8, 2024

@jkleinsc jkleinsc closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
@conteit
Copy link
Author

conteit commented Jan 9, 2024

@jkleinsc, I've open the issue because the one I'm duplicating was stale. Is there any actual plan to fix this behaviour?

@hothaifadev
Copy link

@conteit it's not just a windows 10 issue, i'm using windows 11 and have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants