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
webContent.print
fail because "No valid printers available"
#24664
Comments
This is expected behavior. Our print logic will not proceed unless your machine has a valid printer on the network configured. |
@codebytere This should be the spec when I can show the dialog on xcode and other apps even when there's no printers, because even when there's no printers, PDF, send in mail, etc should be supported. |
sorry @codebytere, would you confirm why electron uses a spec that differs from other apps? And it should work well on electron 6.x |
I can confirm this on Ubuntu 20.04, Linux 5.4.0-45-generic and Electron 10.1.1. |
I'm using Ubuntu 20.04 and Electron 10.1.2 and am experiencing the same issue. |
I ran into this same issue using a BrowserWindow which contains multiple BrowserViews on macOS. As a temporary fix, I used ipcMain to send a message via BrowserView.webContents.send("print") and, within the BrowserView, ipcRenderer to listen for that via ipcRenderer.on("print"). Then, within that listener, I call window.print(). Problem solved for now, though BrowserView.webContents.print() should do the same thing, which instead still returns the error mentioned ("no valid printers available") as of electron@12.0.1. |
Preflight Checklist
Issue Details
When I run
webContents.print
(https://www.electronjs.org/docs/api/web-contents#contentsprintoptions-callback):Instead of popping up a print setting dialog, the
callback
will return withfailureReason
of "No valid printers available".In windows, it works fine.
Expected Behavior
popping up a print setting dialog
Actual Behavior
the
callback
will return withfailureReason
of "No valid printers available".Additional Information
Windows version works fine
The text was updated successfully, but these errors were encountered: