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 give empty paper #41741

Closed
3 tasks done
brkrtp opened this issue Mar 29, 2024 · 6 comments
Closed
3 tasks done

[Bug]: Silent print give empty paper #41741

brkrtp opened this issue Mar 29, 2024 · 6 comments
Labels
blocked/need-repro Needs a test case to reproduce the bug bug 🪲

Comments

@brkrtp
Copy link

brkrtp commented Mar 29, 2024

Preflight Checklist

Electron Version

29.1.6

What operating system are you using?

Windows

Operating System Version

Windows 10 Pro 22H2

What arch are you using?

x64

Last Known Working Electron version

29.1.6

Expected Behavior

I can't print the html document, it just prints out a piece of white paper.

Actual Behavior

it just prints out a piece of white paper in thermal printer

If I remove the silent print feature I can print successfully with the dialog screen, but if I turn on the silent print feature, only a piece of white paper comes out.

Testcase Gist URL

No response

Additional Information

WhatsApp Image 2024-03-29 at 04 09 30

let printerWindow = new BrowserWindow({
width: 800,
height: 800,
show: false
})
return new Promise((resolve, reject) => {
printerWindow.loadURL(printerFile);
printerWindow.webContents.once('crashed', (e) => {
console.error("printerWindow crashed")
reject("crashed");
});
let p1 = new Promise((resolve) => printerWindow.webContents.on('did-finish-load', resolve))
let p2 = new Promise((resolve) => printerWindow.on('ready-to-show', resolve))
Promise.all([p1, p2]).then(() => {
const options = {
silent: true,
deviceName: deviceName,
}
return printerWindow.webContents.print(options, (success, errorType) => {
setTimeout(() => printerWindow.close(), 1000);
if (!success) reject(errorType); else resolve(success)
})
})
})

@S-NOPPY
Copy link

S-NOPPY commented Mar 30, 2024

I also encountered this problem, and it printed fine with version 22.0.0

@MohamedMuflahi
Copy link

I also am experiencing the same issue, it prints correctly, when silent is set to true, and works on mac, but windows produces this blank paper.

@victorcarablut
Copy link

I also encountered this problem, and it printed fine with version 22.0.0

"electron": "^24.8.8" also OK

@Hedwig188
Copy link

This might be the same root cause as #40785

@codebytere codebytere added the blocked/need-repro Needs a test case to reproduce the bug label Apr 4, 2024
@electron-issue-triage
Copy link

Hello @brkrtp. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

@codebytere
Copy link
Member

Closing as a duplicate of #39179 for which i've got a PR up at #41811

@codebytere codebytere closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/need-repro Needs a test case to reproduce the bug bug 🪲
Projects
None yet
Development

No branches or pull requests

6 participants